Hacker News new | past | comments | ask | show | jobs | submit login
Calculator Forensics (rskey.org)
68 points by xeeeeeeeeeeenu on Sept 18, 2021 | hide | past | favorite | 19 comments



My soulver app on iphone says 9 - answer = 1.162985x10^-97 wow. That's basically infinite precision.

But then excel gives a compartively horrible result 8.99999999983268000 (maybe all the casting to and fro degrees and radians makes it worse?)

And python on the same machine, similar: degrees(asin(degrees(acos(degrees(atan(tan(radians(cos(radians(sin(radians(9)))))))))))) = 8.99999999983257


My android calculator app gives me 9.00000... and lets me scroll through the decimal expansion, it's zeros at least to 1000 places, so presumably the calculator's answer is exactly 9.

I wonder if our calculator apps are doing some symbolic computations? Or just have >>64 bit precision (which I presume is the default for excel/python)?


The Android calculator is indeed doing unbounded precision calculations[0.999999999999]. It was developed by Hans-J Boehm, also known for the Boehm-Weiser conservative garbage collector.

[0.999999999999]: https://cacm.acm.org/magazines/2017/8/219594-small-data-comp...


The Android calculator really has no reason to be so excellent, but I greatly appreciate it.

Everything should do unbounded precision. The results are much more human-friendly. And if you're not building a calculator app for humans, who are you building it for?


Using this method (and other related "test" functions) I discovered that the default iOS calculator operates with significantly greater precision that the popular third party "PCalc", which was a little disappointing.


Yeah, the iPhone calculator app has precision to something like 30 decimal places. I think it is probably using 128-bit floating points?


If you like RPN, try freecalc42. I got a plain 9

It implements the HP42, but with a math library w/ 34 decimal digits of precision. You can also buy a calculator, the DM-42 that runs on it and itd be the best calculator in the world if the key board weren't so… bleh


Free42*, no calc.

Also heads up: the automod seems to have banned you. I had to vouch this comment. You might be commenting too fast for a new user or be commenting from an IP it doesn't like.


I have a calculator which doesn't appear on the results table: http://www.rskey.org/~mwsebastian/miscprj/models.htm

It's a "Casio fx-991ES PLUS", and I get 9.00000000733338.

I want to submit this result to the author but I can't find contact information anywhere, despite this page explicitly asking for help: http://www.rskey.org/~mwsebastian/calcinfo.htm


His email is right at the bottom of that page.


D'oh! Don't know why I didn't see that the first time. Thanks.


Interesting. I got 8.999999999959657 on my Mac Mini M1 using Calculator.app.


Calculator app on an iPhone 6s brings it back to 9. Is there some sort emulation shenanigans that are happening?

Using the SC-323 (Sharp calc emulator) app brings it to 9.0000000000000000005. According to the table, this is the same as the Sharp PC-E500 calc.


I believe the Mac and iOS calculator implementations are different.


9.00000000000001 using Python / numpy on an Intel box, converting degrees to radians using numpy's built-in value of pi


Tiger on PowerPC: 8.99999999983257

Catalina on Intel: 9.000000000000055


This is a really cool idea. I think you could get a long way by finding calculations whose results depend on the chip being used.

Even more interesting would be a generalized version that sought to discover properties of an unknown calculator. For example, working out the internal precision by looking at rounding errors, or you could time calculations on numbers of different sizes and make inferences about the size of available memory. This would be cool because you can then apply it to more general sorts of things, like human brains.


> This would be cool because you can then apply it to more general sorts of things, like human brains.

I would expect that to fall apart because the underlying mechanics are different; we know what errors converting between base 2 and 10 look like, but I think it's pretty far from obvious that the same principles extend to whatever everyone's favorite biological neural network uses to execute mathematics. You could do the same kinds of analysis, and it would tell you something interesting probably, I just wouldn't trust inferences made on the basis of lessons learned from digital computers.


I remember as a kid doing:

100/3

ans×3

on different calculators, and at the time being baffled at how they often said 99.9999999.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: