This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author SchorschMCMLX
Recipients SchorschMCMLX
Date 2011-09-02.23:07:32
SpamBayes Score 0.00018203878
Marked as misclassified No
Message-id <1315004853.67.0.138940038832.issue12889@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2011-09-02 23:07:33SchorschMCMLXsetrecipients: + SchorschMCMLX
2011-09-02 23:07:33SchorschMCMLXsetmessageid: <1315004853.67.0.138940038832.issue12889@psf.upfronthosting.co.za>
2011-09-02 23:07:32SchorschMCMLXlinkissue12889 messages
2011-09-02 23:07:32SchorschMCMLXcreate