Smallest float different from 0.0?

Xavier Ho contact at xavierho.com
Mon Sep 7 11:26:46 EDT 2009


This topic came up before. =] See below. Not sure how 'standardised' this
is, though.

Double precision:

>>> import struct
>>> struct.unpack('d', struct.pack('Q', 1))[0]
4.9406564584124654e-324

Float precision:

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

Cheers,
Xavier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090908/08983295/attachment-0001.html>


More information about the Python-list mailing list