Remember Me?

 Straight Dope Message Board Remember Me?

#1
02-10-2020, 01:40 PM
 Guest Join Date: Oct 2016 Posts: 12,738

## 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?
#2
02-10-2020, 01:53 PM
 Guest Join Date: Oct 2018 Posts: 222
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.
#3
02-10-2020, 02:16 PM
 Guest Join Date: Aug 1999 Location: Alabama Posts: 16,400
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.
#4
02-10-2020, 05:21 PM
 Charter Member Moderator Join Date: Jan 2000 Location: The Land of Cleves Posts: 86,733
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)?
#5
02-10-2020, 05:57 PM
 Guest Join Date: Apr 2001 Location: Europe Posts: 6,142
Quote:
 Originally Posted by Chronos 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.
#6
02-10-2020, 06:01 PM
 Charter Member Moderator Join Date: Jan 2000 Location: The Land of Cleves Posts: 86,733
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.
#7
02-10-2020, 06:08 PM
 Guest Join Date: Dec 2006 Location: the hypersphere Posts: 874
Try Cos(2). Pretty sure it's computing the numerical approximation.

Last edited by Chingon; 02-10-2020 at 06:10 PM.
#8
02-10-2020, 06:11 PM
 Guest Join Date: Dec 2010 Posts: 8,345
Quote:
 Originally Posted by Chronos 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.
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.
#9
02-10-2020, 06:16 PM
 Guest Join Date: Dec 2010 Posts: 8,345
Quote:
 Originally Posted by Chingon Try Cos(2). Pretty sure it's computing the numerical approximation.
Well, of course it's computing the numerical approximation. Nevertheless, I checked and it's accurate to at least 500 places.
#10
02-10-2020, 07:01 PM
 Guest Join Date: Oct 2016 Posts: 12,738
Quote:
 Originally Posted by Dr. Strangelove It's painful to check since you have to scroll through the digits manually
You can copy the whole mess to the clipboard and paste it anywhere. Here is 2500 digits of 2020/210:
9.61904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761 9047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047 6190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190 4761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761 9047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047 6190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190 4761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761 9047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047 6190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190 4761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761 9047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047 6190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190 4761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761 9047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047 6190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190 4761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761 9047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047 6190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190 4761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761 9047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047 6190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190 4761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761 9047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047 6190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190476190 4761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761904761 90
#11
02-10-2020, 07:03 PM
 Guest Join Date: Oct 2016 Posts: 12,738
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.
#12
02-10-2020, 07:17 PM
 Guest Join Date: Dec 2006 Location: the hypersphere Posts: 874
Quote:
 Originally Posted by Dr. Strangelove Well, of course it's computing the numerical approximation. Nevertheless, I checked and it's accurate to at least 500 places.
I didn't mean to imply otherwise.

 Bookmarks

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Main     About This Message Board     Comments on Cecil's Columns/Staff Reports     General Questions     Great Debates     Politics & Elections     Cafe Society     The Game Room     Thread Games     In My Humble Opinion (IMHO)     Mundane Pointless Stuff I Must Share (MPSIMS)     Marketplace     The BBQ Pit

All times are GMT -5. The time now is 04:31 AM.

 -- Straight Dope v3.7.3 -- Sultantheme's Responsive vB3-blue Contact Us - Straight Dope Homepage - Archive - Top

Send questions for Cecil Adams to: cecil@straightdope.com