[Python-ideas] math.inf and math.nan constants

Chris Barker chris.barker at noaa.gov
Tue Jan 13 00:43:41 CET 2015

On Mon, Jan 12, 2015 at 3:39 PM, Devin Jeanpierre <jeanpierreda at gmail.com>

> >> So, why is it "math.isnan(x)" and not "x.isnan()"?
> >
> > I'm a little curious about this myself, since float.is_nan(),
> > float.is_inf(), and float.is_finite() are all implemented, but #if 0'd
> > out.
> I'm not Christian, but adding methods to numbers can be annoying
> because you may also have to add it to ints, rationals, decimals, the
> numeric ABCs... At the very least, to ints, anyway.

and there are any number of other things in math that _could_ be methods....



Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150112/6cac26d1/attachment-0001.html>

More information about the Python-ideas mailing list