#12257: 1.0*pi should *not* be pi
-------------------------+-------------------------------------------------
Reporter: was | Owner: burcin
Type: | Status: needs_review
defect | Milestone: sage-6.7
Priority: minor | Resolution:
Component: | Merged in:
calculus | Reviewers:
Keywords: pynac | Work issues:
Authors: Ralf | Commit:
Stephan | 31afae4c1e4e823322795150c65dfce27df18828
Report Upstream: N/A | Stopgaps:
Branch: |
u/rws/12257 |
Dependencies: |
#18088, #18362 |
-------------------------+-------------------------------------------------
Comment (by rws):
Replying to [comment:19 kcrisman]:
> {{{
> sage: sin(1.0*pi)
> sin(1.00000000000000*pi)
> }}}
> which is perhaps also not ideal, if we wanted `0.00000000000` as in the
original intent
I don't think you can expect `0.00000000000` but rather
`1.22464679914735e-16` which is what you get with `sin(1.0*pi).n()`. I
think it's Sage convention (?) that any FP value in an expression should
have the effect of automatically applying `N()` to it.
> So while I agree that one bug is fixed, perhaps this could be repurposed
for that - unless we want to say that `sin(1.0*pi)` is not exact so we
don't actually know it's `0.0`
>... even after the Pynac upgrade in #18362, we have
> {{{
> sage: 0.0*pi
> 0
> }}}
> which is really what is at issue here, I guess. Or?
Yes.
The original ticket was about `1.0`. I added to this cases with `-1.0` and
`0.0` but when fixing stopped short of fixing the `0.0` cases because they
seemed quite different from `+/-1` and I first wanted to fix where I had a
good overview without risk of introducing bugs. So, I think it better if
we open a ticket for `0.0` because this case may need a separate
discussion.
--
Ticket URL: <http://trac.sagemath.org/ticket/12257#comment:20>
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/d/optout.