Marko Rauhamaa writes:
> Ian Kelly:
> 
> > To get nan as a literal just do:
> >
> >     nan = float("nan")
> 
> True, but that got me thinking: what standard Python math operation
> evaluates to NaN?

All manner of arithmetics gives overflow errors ("Numerical result out
of range") but a literal with a large exponent gives an inf, so:

   >>> 0*1e400
   nan

(That's on a Python 3.2.3 ... on linux2.)
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to