Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float('infinity') should be valid #47438

Closed
mdickinson opened this issue Jun 24, 2008 · 2 comments
Closed

float('infinity') should be valid #47438

mdickinson opened this issue Jun 24, 2008 · 2 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@mdickinson
Copy link
Member

BPO 3188
Nosy @mdickinson, @tiran
Files
  • infinity.patch
  • 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 = <Date 2008-07-05.15:23:15.932>
    created_at = <Date 2008-06-24.10:47:34.248>
    labels = ['type-bug']
    title = "float('infinity') should be valid"
    updated_at = <Date 2008-07-05.15:23:15.910>
    user = 'https://github.com/mdickinson'

    bugs.python.org fields:

    activity = <Date 2008-07-05.15:23:15.910>
    actor = 'mark.dickinson'
    assignee = 'mark.dickinson'
    closed = True
    closed_date = <Date 2008-07-05.15:23:15.932>
    closer = 'mark.dickinson'
    components = []
    creation = <Date 2008-06-24.10:47:34.248>
    creator = 'mark.dickinson'
    dependencies = []
    files = ['10716']
    hgrepos = []
    issue_num = 3188
    keywords = ['patch']
    message_count = 2.0
    messages = ['68675', '69281']
    nosy_count = 2.0
    nosy_names = ['mark.dickinson', 'christian.heimes']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue3188'
    versions = ['Python 2.6', 'Python 3.0', 'Python 2.7']

    @mdickinson
    Copy link
    Member Author

    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 mdickinson self-assigned this Jun 24, 2008
    @mdickinson mdickinson added the type-bug An unexpected behavior, bug, or error label Jun 24, 2008
    @mdickinson
    Copy link
    Member Author

    Checked in, r64729.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant