[issue47020] float('nan')==math.nan does NOT evaluate to True (as suggested by documentation).

2022-03-14 Thread Eric V. Smith
Eric V. Smith added the comment: Jelle gives the correct reason for what you're seeing. Also note: >>> math.nan == math.nan False >>> float('nan') == float('nan') False If there's some specific part of the documentation that you think is misleading, please reopen this and point us to the

[issue47020] float('nan')==math.nan does NOT evaluate to True (as suggested by documentation).

2022-03-14 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I'm guessing you're referring to https://docs.python.org/3.8/library/math.html#math.nan. The text says explicitly that math.nan is "equivalent" to float("nan"), not that it is equal. This is correct. nan is not equal to itself, because (for better or

[issue47020] float('nan')==math.nan does NOT evaluate to True (as suggested by documentation).

2022-03-14 Thread Pablo Dumas
New submission from Pablo Dumas : float('nan')==math.nan does NOT evaluate to True (as suggested by documentation). On the other hand, float('inf')==math.inf DOES evaluate to True (as suggested by documentation). Documentation we're referring to: