[New-bugs-announce] [issue11986] Min/max not symmetric in presence of NaN

Alexander Belopolsky report at bugs.python.org
Tue May 3 20:31:28 CEST 2011


New submission from Alexander Belopolsky <belopolsky at users.sourceforge.net>:

>>> nan = float('nan')
>>> min(nan, 5)
nan
>>> min(5, nan)
5

Good arguments can be made in favor of either result, but different value for min(x, y) depending on the order of arguments can hardly be justified.

"In the face of ambiguity, refuse the temptation to guess" suggests that min/max with NaN should be an error.  See also issue 11949.

----------
messages: 135055
nosy: alex, belopolsky, durban, mark.dickinson
priority: normal
severity: normal
status: open
title: Min/max not symmetric in presence of NaN
type: behavior
versions: Python 3.3

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


More information about the New-bugs-announce mailing list