On Sun, Sep 30, 2018 at 09:55:58AM -0400, David Mertz wrote: > Notwithstanding my observation of one case where 'nan <op> float' doesn't > stay a nan, I definitely want something like iNaN. Btw are there other > operations on NaN's do not produce NaN's?
Yes. The (informal?) rule applied by IEEE-754 is that if a function takes multiple arguments, and the result is entirely determined by all the non-NAN inputs, then that value ought to be returned. For example: py> math.hypot(INF, NAN) inf py> 1**NAN 1.0 But generally, any operation (apart from comparisons) on a NAN is usually going to return a NAN. > I suspect a NaNAwareInt subclass is the easiest way to get there, but I'm > agnostic on that detail. I think that adding a NAN to int itself will be too controversial to be accepted :-) -- Steve _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/