GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Document the meaning of values for sys.float_info.rounds · Issue #85988 · python/cpython

Document the meaning of values for sys.float_info.rounds #85988

New issue
Copy link
New issue
Copy link
Closed
Closed
Document the meaning of values for sys.float_info.rounds#85988
Copy link
Labels
3.10 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc direasy

Description

@rhettinger
rhettinger
opened on Sep 21, 2020
Issue body actions
BPO 41822
Nosy @tim-one, @rhettinger, @mdickinson, @serhiy-storchaka, @eamanu, @rahul-kumi

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 = None
closed_at = None
created_at = <Date 2020-09-21.00:38:26.708>
labels = ['easy', '3.10', 'docs']
title = 'Document the meaning  of values for sys.float_info.rounds'
updated_at = <Date 2020-10-18.09:13:18.609>
user = 'https://github.com/rhettinger'

bugs.python.org fields:

activity = <Date 2020-10-18.09:13:18.609>
actor = 'rhettinger'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2020-09-21.00:38:26.708>
creator = 'rhettinger'
dependencies = []
files = []
hgrepos = []
issue_num = 41822
keywords = ['newcomer friendly']
message_count = 5.0
messages = ['377236', '378852', '378853', '378854', '378856']
nosy_count = 7.0
nosy_names = ['tim.peters', 'rhettinger', 'mark.dickinson', 'docs@python', 'serhiy.storchaka', 'eamanu', 'rahul-kumi']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue41822'
versions = ['Python 3.10']

Linked PRs

  • gh-85988: Change documentation for sys.float_info.rounds #99675

Activity

  1. rhettinger commented on Sep 21, 2020

    @rhettinger
    rhettinger
    on Sep 21, 2020
    ContributorAuthor
    More actions

    The current docs unnecessarily refer readers to the C99 standard. "integer constant representing the rounding mode used for arithmetic operations. This reflects the value of the system FLT_ROUNDS macro at interpreter startup time. See section 5.2.4.2.2 of the C99 standard for an explanation of the possible values and their meanings."

    The docs should quote the standard, "The rounding mode for floating-point addition is characterized by the implementation defined value of FLT_ROUNDS: -1 indeterminable, 0 toward zero, 1 to nearest, 2 toward positive infinity, 3 toward negative infinity. All other values for FLT_ROUNDS characterize implementation-defined rounding."
    behavior.

  2. rhettinger
    assigned
    docspython
    on Sep 21, 2020
  3. rhettinger
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    easy
    on Sep 21, 2020
  4. rhettinger
    assigned
    docspython
    on Sep 21, 2020
  5. rhettinger
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    easy
    on Sep 21, 2020
  6. terryjreedy
    added
    3.10 (EOL)end of lifeend of life
    on Sep 25, 2020
  7. terryjreedy
    changed the title [-]Document the mean of values for sys.float_info.rounds[/-] [+]Document the meaning of values for sys.float_info.rounds[/+] on Sep 25, 2020
  8. terryjreedy
    added
    3.10 (EOL)end of lifeend of life
    on Sep 25, 2020
  9. terryjreedy
    changed the title [-]Document the mean of values for sys.float_info.rounds[/-] [+]Document the meaning of values for sys.float_info.rounds[/+] on Sep 25, 2020
  10. rhettinger commented on Oct 18, 2020

    @rhettinger
    rhettinger
    on Oct 18, 2020
    ContributorAuthor
    More actions

    Also, we should document the meaning of the other fields. Several of them are not self explanatory:

    min_10_exp = -307

    does not mean that 2.3e-308 isn't normalized

    does mean that 10**-307 is normalized and 10**-308 isn't

    min_exp = -1021

    does not mean that 2**-1021 is the lowest normalized value

    does mean ldexp(0.5, -1021) == float_info.min

    decimal_dig = 15

    does not mean digits required to specify every unique float

    does mean, "number of decimal digits, q, such that any
    floating-point number with q decimal digits can be rounded
    into a floating-point number with p radix b digits and back
    again without change to the q decimal digits"

  11. serhiy-storchaka commented on Oct 18, 2020

    @serhiy-storchaka
    serhiy-storchaka
    on Oct 18, 2020
    Member
    More actions

    Python does not set the meaning and the value of these fields itself. It exposes C constants. Should we just copy definitions from corresponding C or floating-point standards?

  12. serhiy-storchaka commented on Oct 18, 2020

    @serhiy-storchaka
    serhiy-storchaka
    on Oct 18, 2020
    Member
    More actions

    Oh, seems it was what Raymond proposed initially.

  13. rhettinger commented on Oct 18, 2020

    @rhettinger
    rhettinger
    on Oct 18, 2020
    ContributorAuthor
    More actions

    Here's a link: http://c0x.coding-guidelines.com/5.2.4.2.2.html

  14. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  15. tbwolfe commented on Nov 22, 2022

    @tbwolfe
    tbwolfe
    on Nov 22, 2022
    Contributor
    More actions

    PR submitted. Please let me know if any changes are required.

  16. mdickinson
    added a commit that references this issue on Nov 27, 2022

    gh-85988: Change documentation for sys.float_info.rounds (GH-99675)

    6562939
  17. mdickinson commented on Nov 27, 2022

    @mdickinson
    mdickinson
    on Nov 27, 2022
    Member
    More actions

    Done in #99675. Thanks, @tbwolfe.

  18. mdickinson
    closed this as completedon Nov 27, 2022
  19. hugovk
    added 2 commits that reference this issue on Feb 28, 2023

    pythongh-85988: Change documentation for sys.float_info.rounds (pytho…

    dee1366

    pythongh-85988: Change documentation for sys.float_info.rounds (pytho…

    e6bf616
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc direasy

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.