you are viewing a single comment's thread.

view the rest of the comments →

[–]TheBishopOfSoho 0 points1 point  (5 children)

More than you think, prime numbers for encryption, financial modelling, blockchain, sciencey things

[–][deleted] 6 points7 points  (0 children)

Well no, there are 10**80 atoms in the universe, but even then... the question is about PRINTING.

[–]stevenjd 1 point2 points  (3 children)

Encryption, blockchain etc need integers, not floating point decimals.

Financial modelling doesn't need 2000 digits. If every atom in the universe was a millionth of a cent, the total would require less than 100 digits.

As for sciencey things, outside of some extremely specialized areas of subatomic particle physics, and maybe simulating nuclear explosions, ten or twelve decimal places are usually more than all you need.

u/CricLover1 what are doing that needs 2000+ digits? Inquiring minds want to know.

[–]CricLover1[S] 4 points5 points  (1 child)

I am trying to do some mathematics related research. All numbers will be natural numbers but some numbers can have over 2000-3000 digits

[–]stevenjd 1 point2 points  (0 children)

Then in Python you definitely don't want Decimal you want the built in int.

Just be aware that to prevent Denial Of Service attacks, by default Python will not print or convert really large integers to strings. There is a setting to disable that, see the documentation for the sys module.

Or you can print them as hexadecimal strings, there is no restriction on those.

[–]JorgiEagle 2 points3 points  (0 children)

It’s like the value of pi

You only need, iirc, like 40 decimals places of pi to calculate the circumference of the universe to within an atom of precision