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 Keith.Randall, mark.dickinson
Date 2014-02-07.18:54:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391799269.88.0.917397410242.issue20543@psf.upfronthosting.co.za>
In-reply-to
Content
> Shouldn't floating-point operations overflow to inf, not generate exceptions?

This has been discussed a few times before (I'll try to find the references).

But to answer you question: actually, no.  I think they *should* generate exceptions.  That is, if I were to change anything here, it would be the result of the multiplication, not the result of the ** operation.  IMO, numerically naive users shouldn't be exposed to infinities and NaNs; they should get exceptions for invalid inputs instead.  The math and cmath modules fairly rigorously follow this idea, but as you've discovered the built-in operators aren't so consistent.

Fixing it without breaking existing code and without annoying existing users is tricky, though.
History
Date User Action Args
2014-02-07 18:54:29mark.dickinsonsetrecipients: + mark.dickinson, Keith.Randall
2014-02-07 18:54:29mark.dickinsonsetmessageid: <1391799269.88.0.917397410242.issue20543@psf.upfronthosting.co.za>
2014-02-07 18:54:29mark.dickinsonlinkissue20543 messages
2014-02-07 18:54:29mark.dickinsoncreate