Ask Your Question

Revision history [back]

You can define a "real field" with as many bits of precision as follows (the default is 53):

sage: R = RealField(100)
sage: R
Real Field with 100 bits of precision
sage: a = R(10^25) + R(0.1)
sage: a
1.0000000000000000000000000100e25
sage: a.is_integer()
False

sage: a - 10**25
0.10000610351562500000000000000

If you want a better result for that last question, just add more bits of precision.