[issue11986] Min/max not symmetric in presence of NaN

Mark Dickinson report at bugs.python.org
Sat May 21 21:32:27 CEST 2011


Mark Dickinson <dickinsm at gmail.com> added the comment:

> keep naive implementation of builtin max()

Agreed.

> provide symmetric float.max such that nan.max(x) = x.max(nan) = x (nan
> result would be a valid but less useful alternative.)

That might be viable (a math module function might also make sense here), though it feels a bit YAGNI to me.  If we were going to add such a method, it should follow IEEE 754:  nan.max(x) == x.max(n) == x, but also nan.min(x) == x.min(nan) == x, for finite x.  (See section 5.3.1.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11986>
_______________________________________


More information about the Python-bugs-list mailing list