Live data from Hacker News

Toward an API for the Real Numbers

blog.acolyer.org

1–10 of 85 posts

Re: Toward an API for the Real Numbers

#2
Tangentially related, the stock Android calculator app is fantastic. It has good accuracy as mentioned in the article and an easy to explore and use history. It is one of the few things that will make me hunt around for my phone when I am working on my desktop.

Re: Toward an API for the Real Numbers

#4
post #3

What about NaN values? Are the runtime errors or do they propagate down the chain of execution? Are they comparable?

For a high-level API, shouldn't this be expressed with types such as a `Result` at the library level?

edit: now that I think about it, that would require some really nice optional chaining syntax to be even slightly usable.

Re: Toward an API for the Real Numbers

#6
Looks like a cool library. I'm curious why the Android calculator app needs reliable exact equality tests. It doesn't appear to have an equality test function.

Edit: the paper claims that you need exact equality tests to avoid printing unnecessary zeros at the end of decimal expansions, among other things.

Interesting that this work was done by Hans-J. Boehm, better known for the widely used Boehm garbage collector.

Re: Toward an API for the Real Numbers

#8
post #5
post #3

What about NaN values? Are the runtime errors or do they propagate down the chain of execution? Are they comparable?

There are no NaN values in the real numbers.

You need some way to cope with operations that don’t have real results for some values, such as log and sqrt of negative numbers
Post reply on HN