News for hackers. Stuff that matters.
Re:Calc.exe is now open source; there’s surprising depth in ... by squarefoot on Thursday March 25, 2021 @10:18AM (#26580591)
To bad it's the new one. I still recall the Win3.1 (or possibly 3.11 WFW) calc.exe returning 0 when calculating 2.11 - 2.1 . I've always been curious to know what could have triggered that error since it was too big to remain unnoticed for so much time.
Re:Calc.exe is now open source; there’s surprising depth in ... by tyingq on Thursday March 25, 2021 @10:58AM (#26581077)
I tried it in the "Archive.org Windows 3.11 in a browser" and it returns "0.01".

https://archive.org/details/win3_stock

Re:Calc.exe is now open source; there’s surprising depth in ... by tyingq on Thursday March 25, 2021 @04:47PM (#26585173)
Ah, now confirmed...exists in Windows 3.1, fixed in 3.11

You can try Windows 3.1 here: https://www.pcjs.org/software/pcx86/sys/windows/3.10/

And, indeed, 2.11 - 2.1 = 0.00

But, if you then add 1.0, you get 1.01. So the right value is there somewhere.

Re:Calc.exe is now open source; there’s surprising depth in ... by tyingq on Friday March 26, 2021 @10:23AM (#26592503)
There was a dead comment from another HN person that was actually quite helpful here. Not sure why it was dead, so here's a copy/paste:

"It was fixed in this update for Windows 3.1, which switched away from floating point: https://jeffpar.github.io/kbarchive/kb/124/Q124345/"

Re:Calc.exe is now open source; there’s surprising depth in ... by yuhong on Friday March 26, 2021 @02:42AM (#26589387)
It was fixed in this update for Windows 3.1, which switched away from floating point: https://jeffpar.github.io/kbarchive/kb/124/Q124345/
Re:Calc.exe is now open source; there’s surprising depth in ... by idatum on Thursday March 25, 2021 @02:35PM (#26583735)
Here's another test I do with calculator apps (in radians): Pi - 4 * ATAN(1)

These apps really should produce 0 for this and avoid floating point issues. Most of us understand why it wouldn't. To me it's an experience/quality issue.

For what it's worth, the default Android calc app produces 0 (as well as nice RPN apps like Droid48).

Re:Calc.exe is now open source; there’s surprising depth in ... by dhosek on Thursday March 25, 2021 @03:12PM (#26584167)
My go to calculator is spotlight search on my mac. Pleased to announce that it gives 0 for this.
Re:Calc.exe is now open source; there’s surprising depth in ... by Sharlin on Thursday March 25, 2021 @05:31PM (#26585667)
The macOS calculator, on the other hand, has a totally ridiculous bug: it displays "Not a number" for any negative number that you try to take e^x of. 2^x and 10^x work fine, as does using the x^y button with base e. Typing "e^(-whatever)" on the Spotlight search works, as does e^x of -whatever in the iOS calculator app.
Re:Calc.exe is now open source; there’s surprising depth in ... by jimmaswell on Thursday March 25, 2021 @05:29PM (#26585641)
I just use a wolframalpha for everything these days. It uses symbolic computation so there's no possibility for problems like this, and it's a lot more powerful than any built-in calculator app. Almost anything can be typed in one line with natural English directives like "300mi/14mpg * $2.7/gal to Euros". Especially convenient with a browser keyword.
Re:Calc.exe is now open source; there’s surprising depth in ... by aib on Thursday March 25, 2021 @05:39PM (#26585762)
Check out Qalculate![1] for a program that does that and much more (though obviously not as much as WA).

1: http://qalculate.github.io/

Re:Calc.exe is now open source; there’s surprising depth in ... by patwolf on Thursday March 25, 2021 @06:19PM (#26586285)
I usually use Google for quick calculations but get annoyed when it only returns large results in scientific notation. WolframAlpha gives results in just about every conceivable way, e.g. "7 trillion" or "7 000 000 000 000" instead of 7e+12. Much nicer for someone like me who isn't used to scientific notation.
Re:Calc.exe is now open source; there’s surprising depth in ... by dhosek on Friday March 26, 2021 @10:18AM (#26592449)
But Spotlight is just cmd-space away at all times. My only complaint is that I can't get results for date-based queries like "days since 17 Jan 2021" or "50 days from today" and I have to go to Google for those although I can at least just hit return after entering the query to have the result pop up in Safari.
Re:Calc.exe is now open source; there’s surprising depth in ... by marrone12 on Thursday March 25, 2021 @06:37PM (#26586488)
My biggest complaint after switching to Windows is how poorly the start menu does math. Half the time it tells me "results are unavailable" for simple arithmetic... I don't know if it makes a web query or something to calculate but it's frustrating.
Re:Calc.exe is now open source; there’s surprising depth in ... by stjohnswarts on Thursday March 25, 2021 @05:32PM (#26585679)
Alfred also computes it to 0
Re:Calc.exe is now open source; there’s surprising depth in ... by Jtsummers on Thursday March 25, 2021 @10:25AM (#26580676)
Another comment suggested they switched from floating point to rational number representations after that version. Since 2.11 and 2.1 can't be represented exactly in floating point, it's possible that the issue was the difference was too small (smaller than just .01) and was being rounded off (or was below the limit for number of digits to display).
Re:Calc.exe is now open source; there’s surprising depth in ... by jstimpfle on Thursday March 25, 2021 @10:55AM (#26581029)
Try 2.11 - 2.1 here: http://weitz.de/ieee/ . I don't think they used 32-bit floating point, otherwise there should clearly be a large enough number to display.
Re:Calc.exe is now open source; there’s surprising depth in ... by h2odragon on Thursday March 25, 2021 @03:25PM (#26584337)
in that era, you might or might not have had FPU hardware; where it didn't exist or was off there were a variety of libraries with their own quirks that got used.