When is min(a, b) != min(b, a)?

Jason tenax.raccoon at gmail.com
Mon Jan 21 09:55:40 EST 2008


On Jan 21, 12:00 am, Albert Hopkins <mar... at python.invalid> wrote:
> On Sun, 20 Jan 2008 20:16:18 -0800, Paddy wrote:
> > I am definitely NOT a floating point expert, but I did find this:
> >http://en.wikipedia.org/wiki/IEEE_754r#min_and_max
>
> > P.S. What platform /Compiler are you using for Python?
>
> Linux with GCC 4
>
> -a

Please note that NaN's are very funky and platform dependent.  They
depend on their underlying platform's C library for creation and
display.  On windows, "float('nan')" will cause an exception, as there
are no valid string representations of NAN that can be converted to
the special floating point value.  Also, if you manage to create a nan
under Windows, it displays as "1.#QNAN".

Infinite values are also problematic.  In almost all cases, it is far
better to avoid infinite and NaN values.

  --Jason



More information about the Python-list mailing list