Skip to content

Printing of the largest and other very large floats is wrong #7030

Closed

Description

@auroranockert

If you run std::float::infinity.next_after(1.0)` you get the following (unexpected result)

=> 179769313486231680088648464220646842686668242844028646442228680066046004606080400844208228060084840044686866242482868202680268820402884062800406622428864666882406066422426822086680426404402040202424880224808280820888844286620802664406086660842040886824002682662666864246642840408646468824200860804260804068888.0

the expected result is actually something like

=> 179769313486231580788648464220646842686668242844028646442228680066046004606080400844208228060084840044686866242482868202680268820402884062800406622428864666882406066422426822086680426404402040202424880224808280820888844286620802664406086660842040886824002682662666864246642840408646468824200860804260804068887.0

Activity

  1. huonw commented on Jun 9, 2013

    @huonw
    Contributor

    Related to #6220.

  2. silene commented on Jun 12, 2013

    @silene

    All the large floating-point numbers are multiple of 2^971, so the expected result should not be so odd (pun intended). The largest floating-point number is actually:

    179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
    
  3. metajack commented on Aug 26, 2013

    @metajack
    Contributor

    triage bump. i think one of these bugs should be production ready. nominating this one.

  4. catamorphism commented on Sep 5, 2013

    @catamorphism
    Contributor

    Accepted for production-ready

  5. pnkfelix commented on Mar 20, 2014

    @pnkfelix
    Contributor

    With a heavy heart, not tagging as 1.0 blocker.

    P-high, not 1.0.

  6. tshepang commented on Apr 20, 2015

    @tshepang
    Member

    @pnkfelix why is this not a 1.0 blocker?

  7. pnkfelix commented on Apr 20, 2015

    @pnkfelix
    Contributor

    @tshepang because at the time of that triage, we decided it would be acceptable to fix this after 1.0

    As in, we were not saying we cannot fix it; just that we would not wait for perfection before releasing 1.0

    I do hope the recently posted flt2dec PR gets into 1.0

  8. tshepang commented on Apr 20, 2015

    @tshepang
    Member

    @pnkfelix what I wanted to know is why this was decided. For example, is the fix hard and/or time consuming?

  9. pnkfelix commented on Apr 20, 2015

    @pnkfelix
    Contributor

    Yes, fixing this properly is hard. See PR #24612 for a taste of the difficulty

  10. tshepang commented on Apr 20, 2015

    @tshepang
    Member

    @pnkfelix thanks

  11. added 2 commits that reference this issue on Apr 8, 2021
  12. added a commit that references this issue on Aug 21, 2026
  13. added a commit that references this issue on Aug 29, 2026
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

    P-medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions