Incorrect results for comparison expression
Sage incorrectly evaluates bool(1/47749 <= -5564456128*e + 15125759978)
as False.
In more detail, consider this:
sage: x = -5564456128*e + 15125759978
sage: (1/47749).n(digits=6)
0.0000209428
sage: x.n(digits=20)
0.000020943072740919888020
sage: bool(1/47749 <= x)
False
What is going on? Why does the last boolean evaluate to False? This results in the failure of the assertion that 1/ceil(1/x) <= x
, which should be true mathematically.
Is there a way to compare two quantities that will result in a correct answer, using as much precision as necessary?
Incidentally,
x.n(digits=6)
instead of giving something like0.0000209431
gives1024.00
, which is scary.