This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients alex, belopolsky, daniel.urban, mark.dickinson, pitrou, rhettinger
Date 2011-05-16.18:59:48
SpamBayes Score 7.296547e-08
Marked as misclassified No
Message-id <1305572388.92.0.653201394522.issue11986@psf.upfronthosting.co.za>
In-reply-to
Content
rhettinger> Your other tracker item correctly focused on the behavior of
rhettinger> float('NaN') itself,

You closed issue11949 as well, so it won't help.  I disagree that this issue would be resolved by resolving issue11949.  Defining max(nan, x) and nan < x are two different issues.  Quoting Kahan,

"""
Some familiar functions have yet to be defined for NaN . For instance max{x, y} should deliver the same result as max{y, x} but almost no implementations do that when x is NaN . There are good reasons to define max{NaN, 5} := max{5, NaN} := 5 though many would disagree.
"""
-- Lecture Notes on the Status of IEEE Standard 754 for Binary
Floating-Point Arithmetic by Prof. W. Kahan
http://www.cs.berkeley.edu/~wkahan/ieee754status/ieee754.ps

In the same lecture, Prof. Kahan states that nan < x must signal.

My ideal solution would be to make nan < x signal, keep naive implementation of builtin max() and provide symmetric float.max such that nan.max(x) = x.max(nan) = x (nan result would be a valid but less useful alternative.)

This will make float behavior closer to that of Decimal.
History
Date User Action Args
2011-05-16 18:59:48belopolskysetrecipients: + belopolsky, rhettinger, mark.dickinson, pitrou, alex, daniel.urban
2011-05-16 18:59:48belopolskysetmessageid: <1305572388.92.0.653201394522.issue11986@psf.upfronthosting.co.za>
2011-05-16 18:59:48belopolskylinkissue11986 messages
2011-05-16 18:59:48belopolskycreate