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 mark.dickinson, serhiy.storchaka
Date 2012-05-04.14:50:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1336143001.99.0.907372219017.issue14722@psf.upfronthosting.co.za>
In-reply-to
Content
I don't think this change should be made for 2.7 or 3.2, since it has potential to break existing code.

Though technically, conversion of an out-of-range double to a float gives undefined behaviour (C99 6.3.1.5p2), I'm willing to bet that most current compilers just happily return +-infinity in these cases, and there's probably code out there that would break if we changed this.

So for 2.7 or 3.2, we could just return +-inf here instead.  Though even that isn't quite right if you're picky about corner cases, since there are some values *just* outside [-FLOAT_MAX, FLOAT_MAX] that should still round to +-FLOAT_MAX under round-to-nearest.

I suggest leaving this alone for 2.7 and 3.2

For 3.3, it's not clear to me whether it's better to return +-inf or to raise here.
History
Date User Action Args
2012-05-04 14:50:02mark.dickinsonsetrecipients: + mark.dickinson, serhiy.storchaka
2012-05-04 14:50:01mark.dickinsonsetmessageid: <1336143001.99.0.907372219017.issue14722@psf.upfronthosting.co.za>
2012-05-04 14:50:01mark.dickinsonlinkissue14722 messages
2012-05-04 14:50:01mark.dickinsoncreate