On 3/25/2010 4:14 PM, Guido van Rossum wrote: > On Thu, Mar 25, 2010 at 12:31 PM, Glenn Linderman<v+python at g.nevcal.com> wrote: > >> It is my understand that even bit-for-bit identical NaN values will compare >> unequal according to IEEE 754 rules. >> >> I would have no problem with Python interning each encountered NaN value, to >> avoid having bit-for-bit identical NaN values with different Python IDs, but >> having them compare equal seems inappropriate. >> > Let's please not intern NaNs. Interning is for performance. If you > have enough NaNs to affect your performance I think you have bigger > worries! > I'm OK with interning NaNs, and I'm OK with not interning NaNs. But I would much prefer to see Python conform to the IEEE 754 for float, and the Decimal standard for Decimal, where at all possible, including keeping NaNs not comparing equal to anything, themselves included. And retaining a mode where Decimal is standoffish, and doesn't accept non-Decimal comparisons or arithmetic seems like a big win for program correctness to me. Glenn
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4