#12968: round of symbolic expression (precision issue due to RR)
----------------------------------------------------------------+-----------
Reporter: dkrenn |
Owner: burcin
Type: defect |
Status: positive_review
Priority: major |
Milestone: sage-5.1
Component: symbolics |
Resolution:
Keywords: round symbolic precision RR beginner, sd40.5 | Work
issues:
Report Upstream: N/A |
Reviewers: Burcin Erocal, Karl-Dieter Crisman
Authors: Mike Hansen | Merged
in:
Dependencies: |
Stopgaps:
----------------------------------------------------------------+-----------
Comment (by dsm):
Just before we put this to bed, I noticed a quirk involving negative
numbers. We typically truncate toward zero, like Python:
{{{
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from fractions import Fraction
>>> int(-1)
-1
>>> int(-0.99)
0
>>> int(Fraction(-99, 100))
0
}}}
But our int-ing is a little more sensitive:
{{{
sage: int(-1)
-1
sage: int(-0.99)
0
sage: int(SR(-99/100))
0
sage: -0.99 == -99/100
True
sage: int(-99/100) # ??
-1
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12968#comment:13>
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.