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

Todd toddrjen at gmail.com
Wed Jan 7 14:33:54 CET 2015


The current way to get infinite and nan floats are to do float("inf") and
float("nan"), respectively.  For many applications, this is sufficient.
However, for scientific and mathematical computing, using inf and nan
values is very common, and the current approach is very verbose.  So for
those applications, I think it would be useful if the math standard library
module provided "math.nan" and "math.inf", which would return the same
thing as float("nan") and float("inf"), respectively.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150107/b6e9f357/attachment.html>


More information about the Python-ideas mailing list