#12462: max((5,NaN)) != max((NaN,5))
--------------------------+-------------------------------------------------
    Reporter:  schilly    |         Owner:  burcin  
        Type:  defect     |        Status:  closed  
    Priority:  major      |     Milestone:  sage-5.0
   Component:  symbolics  |    Resolution:  invalid 
    Keywords:             |   Work_issues:          
    Upstream:  N/A        |      Reviewer:          
      Author:             |        Merged:          
Dependencies:             |  
--------------------------+-------------------------------------------------
Changes (by was):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 I think this should be closed as invalid.  In pure Python (nothing to do
 with sage), we have:
 {{{
 $ python
 Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
 [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on
 darwin
 Type "help", "copyright", "credits" or "license" for more information.
 >>> nan = float('nan')
 >>> max(5.0, nan)
 5.0
 >>> max(nan, 5.0)
 nan
 >>> 5.0 > nan
 False
 >>> 5.0 < nan
 False
 }}}

 This is a consequence of how Python's max is defined, and how IEEE defined
 comparison with nan.  Read about that here:
 http://stackoverflow.com/questions/1565164/what-is-the-rationale-for-all-
 comparisons-returning-false-for-ieee754-nan-values

 See also http://stackoverflow.com/questions/4237914/python-max-min-
 builtin-functions-depend-on-parameter-order for a discussion if
 *precisely* this exact issue in Python.

 Again, I say close this as invalid.  If anybody does anything to change
 Sage here, they will just make things incompatible with Python, which is a
 bad, bad idea.   Python has already made this design choice, and we have
 to live with it.

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