#8336: round(x) <> x.round() for x in RealField
--------------------------------+-------------------------------------------
Reporter: zimmerma | Owner: AlexGhitza
Type: defect | Status: new
Priority: critical | Milestone: sage-4.3.4
Component: basic arithmetic | Keywords:
Author: Paul Zimmermann | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
This is related to #188 and #2899.
{{{
sage: R=RealField(150)
sage: x=R(3493274823748475345934875398475345349.9343498375)
sage: y=round(x)
sage: y, type(y)
(3.49327482375e+36, <type 'sage.rings.real_double.RealDoubleElement'>)
sage: z=x.round()
sage: z, type(z)
(3493274823748475345934875398475345350, <type
'sage.rings.integer.Integer'>)
}}}
If one performs {{{ZZ(y)}}} to convert {{{y}}} to an integer, one
has a huge loss of accuracy.
I see no point of forcing coercion to RDF, which has limited precision and
exponent range.
I would expect {{{round(x)}}} to return the same value as {{{z}}},
either as Integer or RealField.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8336>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.