Re:2-in-1 calculator app adds up to surprise hit for retired...
by 5fOleL5Eo2So8qi on Monday September 19, 2022 @04:59PM
(#32903881)
The hard part of writing a calculator app is not parsing `0.1` versus `.1`. That's trivial. The hard part of writing a calculator app is getting precise answers instead of floating-point answers, and given that he thinks the hard part is parsing `.1`, it probably gets it wrong.
[ Parent
| on HN ]
Re:2-in-1 calculator app adds up to surprise hit for retired...
by outworlder on Monday September 19, 2022 @05:54PM
(#32904597)
That's a really large cognitive leap from such a small amount of data.
Have you considered that they may not be using floating point numbers at all? They might be using arbitrary precision arithmetic. That was probably implemented by a library. So not as much effort as you would think.
Re:2-in-1 calculator app adds up to surprise hit for retired...
by kccqzy on Monday September 19, 2022 @05:28PM
(#32904257)
Solved by https://www.hboehm.info/new_crcalc/CRCalc.html
Also, this is in the Android stock calculator so lifting the code over is easy. See also https://dl.acm.org/doi/10.1145/2911981