4 ms·
There 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
by psyklic 8y ago
There 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.