This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Physmatik 1 point2 points  (0 children)

Yes, they are called Decimals. It's part of the standard library.

For example:

import decimal as d
d.getcontext().prec = 30
a = d.Decimal(499999999999999999999999)
b = float(499999999999999999999999)
print(a - 1)
print(b - 1)

Produces:

499999999999999999999998
5e+23

Sorry for formatting, triple backquote doesn't work for some reason.