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 mark.dickinson
Recipients christian.heimes, collinwinter, facundobatista, mark.dickinson, richardh2003, tim.peters
Date 2008-01-20.05:10:48
SpamBayes Score 0.0029168192
Marked as misclassified No
Message-id <1200805851.1.0.932257164449.issue705836@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-01-20 05:10:51mark.dickinsonsetspambayes_score: 0.00291682 -> 0.0029168192
recipients: + mark.dickinson, tim.peters, collinwinter, facundobatista, richardh2003, christian.heimes
2008-01-20 05:10:51mark.dickinsonsetspambayes_score: 0.00291682 -> 0.00291682
messageid: <1200805851.1.0.932257164449.issue705836@psf.upfronthosting.co.za>
2008-01-20 05:10:49mark.dickinsonlinkissue705836 messages
2008-01-20 05:10:49mark.dickinsoncreate