#12600: machine epsilon for RR, RDF, ...
-----------------------------------+----------------------------------------
       Reporter:  dkrenn           |         Owner:  jason, jkantor
           Type:  enhancement      |        Status:  new           
       Priority:  major            |     Milestone:  sage-5.0      
      Component:  numerical        |    Resolution:                
       Keywords:  machine epsilon  |   Work issues:                
Report Upstream:  N/A              |     Reviewers:                
        Authors:                   |     Merged in:                
   Dependencies:                   |      Stopgaps:                
-----------------------------------+----------------------------------------

Comment (by poeschko):

 IMHO this is exactly what `ulp()` provides. From the docs:

     Returns the unit of least precision of self, which is the weight of
 the least significant bit of self. Unless self is exactly a power of
     two, it is gap between this number and the next closest distinct
     number that can be represented.

 It gives the following:
 {{{
 sage: RR(1).ulp()
 2.22044604925031e-16
 sage: RDF(1).ulp()
 1.11022302463e-16
 }}}

 Of course, `ulp` is unbounded:
 {{{
 sage: RDF(10**100).ulp()
 9.71334446113e+83
 sage: RDF(10**-100).ulp()
 6.34485459329e-117
 }}}

 The only thing that I can imagine adding is a class method `eps()` to `RR`
 and `RDF` that returns `one().ulp()`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12600#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.

Reply via email to