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

Decimal to floating point conversion #27307

Merged
merged 7 commits into from
Aug 13, 2015
Merged

Commits on Aug 8, 2015

  1. Make core::num::dec2flt::strategy::grisu::Fp methods public.

    The intent is to allow decimal-to-float parsing to use Fp in its fast path.
    That code is added in a later commit.
    Robin Kruppe committed Aug 8, 2015
    Configuration menu
    Copy the full SHA
    b55806c View commit details
    Browse the repository at this point in the history
  2. Enlarge Bignum type from 1152 to 1280 bits.

    This is necessary for decimal-to-float code (in a later commit) to handle
    inputs such as 4.9406564584124654e-324 (the smallest subnormal f64).
    According to the benchmarks for flt2dec::dragon, this does not
    affect performance measurably. It probably uses slightly more stack
    space though.
    Robin Kruppe committed Aug 8, 2015
    Configuration menu
    Copy the full SHA
    7ff1020 View commit details
    Browse the repository at this point in the history
  3. Add various methods to Bignum:

    - Exposing digits and individual bits
    - Counting the number of bits
    - Add small (digit-sized) values
    - Multiplication by power of 5
    - Division with remainder
    
    All are necessary for decimal to floating point conversions.
    All but the most trivial ones come with tests.
    Robin Kruppe committed Aug 8, 2015
    Configuration menu
    Copy the full SHA
    7ebd7f3 View commit details
    Browse the repository at this point in the history
  4. Script for generating the powers-of-ten tables necessary for correct and

    fast decimal-to-float conversions.
    Robin Kruppe committed Aug 8, 2015
    Configuration menu
    Copy the full SHA
    b7e39a1 View commit details
    Browse the repository at this point in the history
  5. Accurate decimal-to-float parsing routines.

    This commit primarily adds implementations of the algorithms from William
    Clinger's paper "How to Read Floating Point Numbers Accurately". It also
    includes a lot of infrastructure necessary for those algorithms, and some
    unit tests.
    
    Since these algorithms reject a few (extreme) inputs that were previously
    accepted, this could be seen as a [breaking-change]
    Robin Kruppe committed Aug 8, 2015
    Configuration menu
    Copy the full SHA
    ba792a4 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2015

  1. Add optional, external tests for floating point parsing.

    Running these tests takes hours, so they are not run by @bors.
    Robin Kruppe committed Aug 9, 2015
    Configuration menu
    Copy the full SHA
    82dbc2e View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2015

  1. Mention that the fast path is broken without SSE.

    Robin Kruppe committed Aug 12, 2015
    Configuration menu
    Copy the full SHA
    15518a9 View commit details
    Browse the repository at this point in the history