On Thu, Mar 25, 2010 at 3:01 PM, Curt Hagenlocher <c...@hagenlocher.org> wrote: > On Thu, Mar 25, 2010 at 7:54 AM, Mark Dickinson <dicki...@gmail.com> wrote: >> >> Hmm. I take it back. I was being confused by the fact that sqrt(nan) >> returns a nan with a new identity; but it does apparently preserve >> the payload. An example: > > I played with this some a few months ago, and both the FPU and the C > libraries I tested will preserve the payload. I imagine Python just > inherits their behavior.
Pretty much, yes. I think we've also taken care to preserve payloads in functions that have been added to the math library as well (e.g., the gamma function). Not that that's particularly hard: it's just a matter of making sure to do "if (isnan(x)) return x;" rather than "if (isnan(x)) return standard_python_nan;". If that's not true, then there's a minor bug to be corrected. Mark _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com