Any built-in function for smallest positive floating point number?
Xavier Ho
contact at xavierho.com
Tue Aug 11 21:49:00 EDT 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-0001.html>
More information about the Python-list
mailing list