New submission from TD22057 <[EMAIL PROTECTED]>:

FYI Actual version is 2.5.2 running on Linux RHE4.

>>> import struct
>>> fmt ='>f'
>>> v=1.8183e-7
>>> v
1.8183000000000001e-07
>>> s=struct.pack(fmt,v)
>>> struct.unpack(fmt,s)
(1.818300034983622e-07,)

Looks to me like the float->double conversion is not being zeroed out
before the 4 bytes are written to it.  FYI this is a fairly serious
issue since it leads to incorrect results be read from files (at least
for me anyway).

----------
components: Extension Modules
messages: 74690
nosy: TD22057
severity: normal
status: open
title: struct returns incorrect 4 byte float
type: behavior
versions: Python 2.5.3

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4114>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to