Chris Angelico writes:
> On Fri, Jan 9, 2015 at 1:37 AM, Marko Rauhamaa wrote:
> >
> > True, but that got me thinking: what standard Python math
> > operation evaluates to NaN?
> 
> Subtracting infinity from infinity is one easy way.
> 
> >>> 1e309
> inf
> >>> 1e309-1e309
> nan

I managed to get inf by arithmetic on finite numbers:

  >>> 1e300/1e-300
  inf

  >>> o = 1e300/1e-300 ; o-o
  nan
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to