#12257: 1.0*pi should *not* be pi
------------------------+---------------------------------------------------
Reporter: was | Owner: burcin
Type: defect | Status: new
Priority: minor | Milestone: sage-5.0
Component: calculus | Keywords: pynac
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
------------------------+---------------------------------------------------
Changes (by burcin):
* keywords: => pynac
Comment:
There are two sides to this. Doing the multiplication and printing the
coefficient.
GiNaC takes a shortcut when the coefficient is 1 and skips multiplication.
There is a Python callback function
(`sage.symbolics.pynac.py_get_parent_char`) to check the characteristic of
the parent. Pynac forces the operation for positive characteristic. If we
return a positive integer from that function when the parent is inexact,
the multiplication will go through.
If a coefficient is 1, we don't print it. So the printing code in pynac
needs to be changed to print inexact coefficients. This is now
[https://bitbucket.org/burcin/pynac/issue/4/ pynac issue #4].
Even when all these are sorted out, `sin(1.0*pi)` might still return 0.
Since `bool(1.0*pi == pi)` will probably be True.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12257#comment:1>
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.