New submission from Dr. Georg Ströhlein <schorsch_mc...@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 <rep...@bugs.python.org> <http://bugs.python.org/issue12889> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com