#15388: log of NaN in RealField and ComplexField results in infinite loop
-----------------------------+-------------------------------------------
Reporter: paulfili | Owner: Paul Fili
Type: defect | Status: new
Priority: minor | Milestone: sage-5.13
Component: PLEASE CHANGE | Keywords: sage-days55
Merged in: | Authors: Paul Fili, Adam Towsley
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
-----------------------------+-------------------------------------------
If you have a RealField or ComplexField NaN value and attempt to compute
log, the fact that NaN is considered < 0 results in RealField.log calling
ComplexField.log, but then ComplexField.log calls RealField.log again, but
again on the values NaN for the absolute value. This results in an
infinite loop. Example code for the code:
x = RealField()(NaN)
x.log() # Results in infinite loop
This patch fixes the log function in RealField and ComplexField to return
NaN if fed a number which is NaN (in either the real or the imaginary
coordinate).
--
Ticket URL: <http://trac.sagemath.org/ticket/15388>
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.