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
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to