[New-bugs-announce] [issue12889] struct.pack('d'... problem

Dr. Georg Ströhlein report at bugs.python.org
Sat Sep 3 01:07:33 CEST 2011


New submission from Dr. Georg Ströhlein <schorsch_mcmlx at yahoo.de>:

Hi all,

I think there is a long-standing bug (it has made it into books on Google...) in the struct.pack() function, at least if the 'd' format string is selected. On both Win and Ubuntu the string returned for pack('!d',1.2345) is '?\xf3\xc0\x83\x12n\x97\x8d', whereas the correct 8 (!!) bytes are 3F F3 C0 83 12 6E 97 8D.

Link to a published VBA UDF for Excel is in the file; that UDF reproduces the examples given in wikipedia on the IEEE 754 / DP pages correctly. 

Regards, Schorsch

----------
files: python-error.txt
messages: 143443
nosy: SchorschMCMLX
priority: normal
severity: normal
status: open
title: struct.pack('d'... problem
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file23090/python-error.txt

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12889>
_______________________________________


More information about the New-bugs-announce mailing list