#12557: RDF(1e-17).log() gives NaN
------------------------------------+---------------------------------------
Reporter: mariah | Owner: AlexGhitza
Type: defect | Status: needs_work
Priority: minor | Milestone: sage-5.1
Component: basic arithmetic | Resolution:
Keywords: sd40.5 | Work issues:
Report Upstream: N/A | Reviewers: Volker Braun
Authors: | Merged in:
Dependencies: | Stopgaps:
------------------------------------+---------------------------------------
Changes (by vbraun):
* keywords: => sd40.5
* reviewer: => Volker Braun
* status: needs_review => needs_work
Comment:
Fixes the bug!
I think a better doctest would be to check that it is below one ulp:
{{{
sage: def check_error(x):
... log_RDF = CDF(x).log().real()
... log_exact = log(x.n(1000))
... return abs(log_RDF-log_exact) <= log_RDF.ulp()
sage: all( check_error( RDF(2^x) ) for x in range(-100,100) )
True
}}}
Also, instead of dividing `0/0` why not return `RDF.NaN()`?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12557#comment:5>
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.