Mark Dickinson added the comment:

Here's a patch that fixes the test that Collin mentioned to reflect what's 
actually been 
happening for the last nearly 5 years, and changes _PyFloat_Pack4 and 
_PyFloat_Pack8, as 
follows.

When packing a float that's too large for the destination format (e.g. 
pack(">f", 1e39)):

 - before the patch, _PyFloat_Pack* gives an OverflowError on non-IEEE-754 
platforms and
   an IEEE infinity on IEEE-754 platforms.

 - after the patch, _PyFloat_Pack* gives an IEEE infinity on all platforms.

This patch doesn't fix the problem that the cast from double to float on IEEE 
machines 
involves potentially undefined behaviour;  I think that should be considered a 
separate 
issue.

Added file: http://bugs.python.org/file9240/705836.patch

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

Reply via email to