4 ms·
Seems the issue occurs at some range (10^0,39794 - ?] 10^0,43407 - Invalid Input 10^0,00001 - OK 10^0,50001 - Invalid Input 10^0,40001 - Invalid Input
by gabriel34 8y ago
Seems the issue occurs at some range (10^0,39794 - ?]
10^0,43407 - Invalid Input
10^0,00001 - OK
10^0,50001 - Invalid Input
10^0,40001 - Invalid Input
10^0,30001 - OK
10^0,35001 - OK
10^0,39999 - Invalid Input
10^0,37501 - OK
10^0,38751 - OK
10^0,39375 - OK
10^0,39794 - OK
10^0,39795 - Invalid Input
But when I tried better approximations things got weird
10^0,397941 - Invalid Input
10^0,397940000001 - Invalid Input
Seems six or more decimal places result in Invalid Input
10^0,39375 - OK
10^0,393751 - Invalid Input
10^0,39376 - OK
Even well outside the range
10^0,123456 - Invalid Input
- psyklic 8y agoThere seems to be a clear pattern for > 5 digits after the decimal: 5 digits - Valid: <=0.39794, Invalid: >=0.39795 10^0.39794 < 2.5 10^0.39795 > 2.5 6 digits - Valid: <=0.043429, Invalid: >=0.043431 7 digits - Valid: <=0.0043429, Invalid: >=0.0043431 8 digits - Valid: <=0.00043429, Invalid: >=0.00043431 The pattern seems to continue as the number of decimal places increases.
- barbegal 8y ago10^0.043429 ~= e^0.1 10^0.0043429 ~= e^0.01 10^0.00043429 ~= e^0.001 So that gives some insight into the algorithm that is being used
- gabriel34 8y agoUsing this we can actually predict the smallest exponent that fails for other bases: base exponent (6 digits) 10 0.043429 11 0.041703 12 0.040243 2 0.144271 3 0.091024 4 0.072135 1000 0.014476 (the calculated exponent for two is actually 0.144270, but since it ends in zero the first failure occurs at 0.144271)
- imran3740 8y agoJust checked, calc fails at 11^0.41703 (curiously not at 41703, but 41704, maybe a floating point thing). Maybe it changes base to e and uses the Taylor series for e^x, but fails if x is too precise for what it expects?
- psyklic 8y agoFantastic, that confirms it! And kudos to barbegal for recognizing the base.
- craftyguy 8y agoif only the source code were publicly available, then the real problem could be realized, patches proposed, etc. enjoy waiting on microsoft to patch it, they're probably too busy 'loving open source.'
- userbinator 8y agoEven from a strictly business standpoint it certainly makes sense to open-source things like the calculator, since I doubt the source contains any proprietary IP that gives it any particular competitive advantage --- and in the "basic calculator app" space, there is certainly a lot of competition. Then again, the fact that they managed to break one of the most conceptually simple applications that comes with Windows --- for seemingly no good reason at all --- speaks volumes about the quality of MS products these days...
- zeusk 8y agohttps://www.macrumors.com/2017/10/30/ios-11-2-beta-fixes-calculator-animation-bug/ https://www.macrumors.com/2017/10/30/ios-11-2-beta-fixes-cal... http://nuclearrambo.com/wordpress/google-calculator-bug-3999999999999/ http://nuclearrambo.com/wordpress/google-calculator-bug-3999... Things break.
- userbinator 8y agoI'm not sure what you're trying to say. Are we supposed to consider it normal that something which used to work is now broken? I hope not, especially with something as well-defined as a calculator.
- zeusk 8y ago> Then again, the fact that they managed to break one of the most conceptually simple applications that comes with Windows --- for seemingly no good reason at all --- speaks volumes about the quality of MS products these days...
- deleted 8y ago