#15542: Rounding weirdness when increasing the precision of a real number
----------------------------+----------------------------------------------
       Reporter:            |        Owner:
  mmezzarobba               |       Status:  positive_review
           Type:  defect    |    Milestone:  sage-duplicate/invalid/wontfix
       Priority:  major     |   Resolution:
      Component:            |    Merged in:
  numerical                 |    Reviewers:  Jeroen Demeyer
       Keywords:            |  Work issues:
        Authors:            |       Commit:
Report Upstream:  N/A       |     Stopgaps:
         Branch:            |
   Dependencies:            |
----------------------------+----------------------------------------------

Comment (by zimmerma):

 ok, but then this is definitively a bug:
 {{{
 sage: a=RealField(53)(1.0e-20)
 sage: Reals(200)(a)
 1.0000000000000000000000000000000000000000000000000000000000e-20
 sage: Reals(200)(a.exact_rational())
 9.9999999999999994515327145420957165172950370278739244710772e-21
 }}}
 Since a 53-bit floating-point value is exactly representable with a
 precision of 200 bits, we should have {{{Reals(200)(a) ==
 Reals(200)(a.exact_rational())}}}. Otherwise Sage is not IEEE-754
 compliant (despite MPFR being compliant).

 Paul

--
Ticket URL: <http://trac.sagemath.org/ticket/15542#comment:5>
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.

Reply via email to