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

New floating-to-decimal formatting routine #24612

Merged
merged 9 commits into from
May 9, 2015
Merged

Commits on May 6, 2015

  1. core: added core::num::flt2dec for floating-point formatting.

    This is a fork of the flt2dec portion of rust-strconv [1] with
    a necessary relicensing (the original code was licensed CC0-1.0).
    Each module is accompanied with large unit tests, integrated
    in this commit as coretest::num::flt2dec. This module is added
    in order to replace the existing core::fmt::float method.
    
    The forked revision of rust-strconv is from 2015-04-20, with a commit ID
    9adf6d3571c6764a6f240a740c823024f70dc1c7.
    
    [1] https://github.com/lifthrasiir/rust-strconv/
    lifthrasiir committed May 6, 2015
    Configuration menu
    Copy the full SHA
    c82da7a View commit details
    Browse the repository at this point in the history
  2. core: made the core formatter to use a new flt2dec.

    As a side effect `core::fmt::float` is gone now. This also slightly
    changes the float output, so this is:
    
    [breaking-change]
    lifthrasiir committed May 6, 2015
    Configuration menu
    Copy the full SHA
    5aa9f38 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f9bfda0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    85424c4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8a195f0 View commit details
    Browse the repository at this point in the history
  6. core: fixed a slight bug.

    The bug involves the incorrect logic for `core::num::flt2dec::decoder`.
    This makes some numbers in the form of 2^n missing one final digits,
    which breaks the bijectivity criterion. The regression tests have been
    added, and f32 exhaustive test is rerun to get the updated result.
    lifthrasiir committed May 6, 2015
    Configuration menu
    Copy the full SHA
    97ea7c1 View commit details
    Browse the repository at this point in the history
  7. core: updated for the master changes.

    The master no longer has `std::num::Float`, so a generic `ldexp` is
    not readily available. `DecodableFloat::ldexpi` works around this.
    lifthrasiir committed May 6, 2015
    Configuration menu
    Copy the full SHA
    a641b05 View commit details
    Browse the repository at this point in the history
  8. core: use banker's rounding for the exact mode in flt2dec.

    For the shortest mode the IEEE 754 decoder already provides
    an exact rounding range accounting for banker's rounding,
    but it was not the case for the exact mode. This commit alters
    the exact mode algorithm for Dragon so that any number ending at
    `...x5000...` with even `x` and infinite zeroes will round to
    `...x` instead of `...(x+1)` as it was. Grisu is not affected
    by this change because this halfway case always results in
    the failure for Grisu.
    lifthrasiir committed May 6, 2015
    Configuration menu
    Copy the full SHA
    3d34e17 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2015

  1. Configuration menu
    Copy the full SHA
    1aecd17 View commit details
    Browse the repository at this point in the history