Live data from Hacker News

A calculator that doesn't round

constructive-calculator.dimview.org

11–20 of 28 posts

Re: A calculator that doesn't round

#14
> I built one, by porting Boehm’s engine. > It’s 2026, so I didn’t hand-write the port. I directed Opus 4.8 to translate the source line by line into Swift

I wish I could filter out stuff like this. Cool work by Hans Boehm, but what's the value add in this blog post.

Re: A calculator that doesn't round

#15
post #2

Author here. I could not find a constructive‑reals calculator on iPhone, so I ported the engine Android uses: Hans Boehm's com.hp.creals plus AOSP's UnifiedReal/BoundedRational. Used Opus 4.8 to do the port and Fable 5 for the review. Fable 5 caught a couple of real concurrency bugs the port introduced while adapting Java's synchronized/AsyncTask to Swift concurrency, including one that was a memory‑safety bug on sha…

Maybe you should correct the errors in your post before worrying about the code.

Re: A calculator that doesn't round

#16
post #7

> Hans Boehm built a Java library for this in the 1980s and 90s Hans is such a prolific programmer that he wrote a Java library before Java was even invented?

Well, you know, you go into your Smalltalk-80 workstation for a hack sesh, and an all-nighter later you end up with an implementatkon of Swing...

Re: A calculator that doesn't round

#17
post #14

> I built one, by porting Boehm’s engine. > It’s 2026, so I didn’t hand-write the port. I directed Opus 4.8 to translate the source line by line into Swift I wish I could filter out stuff like this. Cool work by Hans Boehm, but what's the value add in this blog post.

Read. Guy knows what he's doing.

Re: A calculator that doesn't round

#19

btw if you turn the iphone calc into landscape mode and switch you scientific calc it does Ramanujan's constant without rounding, but stops after the twelve 9s.

Correct, but if you don't know the next digit is 2, you can think it's all 9s, another representation of an integer number.

Re: A calculator that doesn't round

#20
post #8
post #2

Author here. I could not find a constructive‑reals calculator on iPhone, so I ported the engine Android uses: Hans Boehm's com.hp.creals plus AOSP's UnifiedReal/BoundedRational. Used Opus 4.8 to do the port and Fable 5 for the review. Fable 5 caught a couple of real concurrency bugs the port introduced while adapting Java's synchronized/AsyncTask to Swift concurrency, including one that was a memory‑safety bug on sha…

The old HP calculators, and their emulators, have a computer algebra system, for symbolic maths, that supported this. The user interfaces leave much to be desired, but some also have reverse Polish notation!

This is different from a CAS. For example, if you ask it to do exp(100)+1-exp(100), it does not rearrange and cancel out the two exp(100)s. Instead, it does exp, addition, and subtraction, all with as many digits as you ask for.
Post reply on HN