# Number of decimal places on Android 9 calculator?

I just accidentally discovered that on the Android 9 calculator, if you swipe across the total it adds decimal places. I swiped a few times on a number and got it up over 500 decimal places before quitting. Anyone know what the limit is?

Hm, “double precision” type variables in computing are good to only about 15 or 16 decimal places.

Not sure how they could get to 500 decimal places accurately, or for that matter, why anyone would want an android calculator app to output at this level of precision.

I hit the “pi” button and checked, it seems to be correct at least to 1000 digits. That may be a special case for built-in constants, but I’d guess it uses some type of arbitrary precision library.

If you have some means for checking that many digits, but want to rule out it just being for built-in constants, maybe try sqrt(2)?

If any constants are built into Android, then sqrt(2) has got to be in the top three.

pi and e probably are, but I doubt that sqrt(2) would come up enough more often than any other square root to make it worthwhile. But if you’re worried about it, just use sqrt(3) or sqrt(17) or something.

Try Cos(2). Pretty sure it’s computing the numerical approximation.

I did a little test (source) of sqrt(33337777), and indeed the Android calculator seems to be arbitrary precision. It’s painful to check since you have to scroll through the digits manually, but I did spot checks at a few positions and it matches up to 80+ digits.

At any rate, none of this is difficult. I wrote an arbitrary precision library a while back to learn how FFTs work. Millions of digits take just a fraction of a second even on a 20 year old computer. A modern phone that only has to work at human input rates is a piece of cake.

Well, of course it’s computing the numerical approximation. Nevertheless, I checked and it’s accurate to at least 500 places.

You can copy the whole mess to the clipboard and paste it anywhere. Here is 2500 digits of 2020/210:
9.6190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190

And I’m just wondering if there is a hard cutoff on the number of digits it will display, or if it will keep going until memory runs out.

I didn’t mean to imply otherwise.