#15542: Rounding weirdness when increasing the precision of a real number
---------------------------+----------------------------
Reporter: mmezzarobba | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.1
Component: numerical | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
---------------------------+----------------------------
This is not correct:
{{{
sage: Reals(200)(RR(1.0e-20))
1.0000000000000000000000000000000000000000000000000000000000e-20
}}}
since `RR(1.0e-20)` is actually equal to 6646139978924579ยท2^-119^, and
indeed:
{{{
sage: Reals(200)(RR(1.0e-20).exact_rational())
9.9999999999999994515327145420957165172950370278739244710772e-21
}}}
Also note that the following related examples work:
{{{
sage: Reals(200)(RDF(1.0e-20))
9.9999999999999994515327145420957165172950370278739244710772e-21
sage: ComplexField(200)(CC(1.0e-20))
9.9999999999999994515327145420957165172950370278739244710772e-21
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/15542>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.