Bugs item #1483963, was opened at 2006-05-08 13:05 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1483963&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Christian Hudon (chrish42) Assigned to: Nobody/Anonymous (nobody) Summary: struct.unpack problem with @, =, < specifiers Initial Comment: When using struct to unpack floats, I'm getting inconsistent results when using the '<d' specification instead of '@d' on a little-endian machine (Intel). Here's a short python snippet that demonstrates the problem. import sys, struct s = '\x00\x00\x00\x00\x00\x00\xf8\x7f' >>> sys.byteorder 'little' # This is correct... >>> struct.unpack('@d', s) (nan,) # These should be equivalent for unpacking a single # double on little-endian arch... but they're not. >>> struct.unpack('<d', s) (inf,) >>> struct.unpack('=d', s) (inf,) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1483963&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com