Any built-in function for smallest positive floating point number?

Xavier Ho contact at xavierho.com
Wed Aug 12 03:49:00 CEST 2009


Actually, that was double precision. You asked for float precision.

>>> struct.unpack('f', struct.pack('L', 1))[0]
1.4012984643248171e-45

which is the same as:
>>> 2**-149
1.4012984643248171e-45

I think that's it. Sorry for posting to the list three times in a row.
corrections welcome.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090812/a501f95f/attachment.html>


More information about the Python-list mailing list