You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/mdickinson'closed_at=<Date2008-07-05.15:23:15.932>created_at=<Date2008-06-24.10:47:34.248>labels= ['type-bug']
title="float('infinity') should be valid"updated_at=<Date2008-07-05.15:23:15.910>user='https://github.com/mdickinson'
2.6 adds float('inf') and float('nan') as cross-platform ways to
generate infinities and NaNs. The C99 standard (section 7.20.1.3,
paragraph 3) specifies that 'infinity' (in any case, with optional
preceding sign) should also be a valid input to strtod, and I propose
that in Python float('infinity') should correspondingly be valid.
Note that the IEEE 754 standard also states that 'inf' and 'infinity'
should be valid input string representations of infinity, and Python's
decimal module also allows both 'inf' and 'infinity'.
A patch is attached.
Unless I'm mistaken, this change is simple and unlikely to be
controversial. I plan to check it in in a week or two if there's no
feedback before then.
Activity
mdickinson commentedon Jun 24, 2008
2.6 adds float('inf') and float('nan') as cross-platform ways to
generate infinities and NaNs. The C99 standard (section 7.20.1.3,
paragraph 3) specifies that 'infinity' (in any case, with optional
preceding sign) should also be a valid input to strtod, and I propose
that in Python float('infinity') should correspondingly be valid.
Note that the IEEE 754 standard also states that 'inf' and 'infinity'
should be valid input string representations of infinity, and Python's
decimal module also allows both 'inf' and 'infinity'.
A patch is attached.
Unless I'm mistaken, this change is simple and unlikely to be
controversial. I plan to check it in in a week or two if there's no
feedback before then.
mdickinson commentedon Jul 5, 2008
Checked in, r64729.