4 ms·
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 wh
by squarefoot 6y ago
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.
- Jtsummers 6y agoAnother 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).
- jstimpfle 6y agoTry 2.11 - 2.1 here: http://weitz.de/ieee/ 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.
- tyingq 6y agoI tried it in the "Archive.org Windows 3.11 in a browser" and it returns "0.01". https://archive.org/details/win3_stock https://archive.org/details/win3_stock
- tyingq 6y agoAh, 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/ 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.
- yuhong 6y agoIt was fixed in this update for Windows 3.1, which switched away from floating point: https://jeffpar.github.io/kbarchive/kb/124/Q124345/ https://jeffpar.github.io/kbarchive/kb/124/Q124345/
- tyingq 6y agoThere 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/ https://jeffpar.github.io/kbarchive/kb/124/Q124345/"
- idatum 6y agoHere'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).
- dhosek 6y agoMy go to calculator is spotlight search on my mac. Pleased to announce that it gives 0 for this.
- jimmaswell 6y agoI 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.
- aib 6y agoCheck out Qalculate![1] for a program that does that and much more (though obviously not as much as WA). 1: http://qalculate.github.io/ http://qalculate.github.io/
- patwolf 6y agoI 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.
- dhosek 6y agoBut 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.
- h2odragon 6y agoin 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.