Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
base: 0a375f504ca5
Choose a base ref
...
head repository: crystal-lang/crystal
compare: 32f583fbf091
Choose a head ref
  • 5 commits
  • 11 files changed
  • 1 contributor

Commits on Jun 4, 2017

  1. Add FloatPrinter based on Grisu3

    This improves the speed of transforming floats to their string
    representation. It is based on the 2004 paper "Printing Floating-Point
    Numbers Quickly and Accurately with Integers" by Florian Loitsch[1].
    
    Most of the code is a port from the BSD-licensed C++ project
    "double-conversion"[2], which was extracted from the V8 engine.
    
    The Grisu3 algorithm is fast because it deals only with fixed-sized
    integer arithmetic. It takes advantage extra bits leftover from the
    53-bit significand in a 64 bit number to help find the optimal string
    representation. However this only works for 95.5% of floats and it
    rejects the remaining 0.5%. Rejected numbers still need to be printed
    with some other, slower method.
    
    1: http://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf
    2: https://github.com/google/double-conversion
    will authored and asterite committed Jun 4, 2017
    Copy the full SHA
    08dcf53 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    d8c8417 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    5e1df56 View commit details
    Browse the repository at this point in the history
  4. FloatPrinter: add Float32 support

    will authored and asterite committed Jun 4, 2017
    Copy the full SHA
    576f815 View commit details
    Browse the repository at this point in the history
  5. FloatPrinter: add license to specs

    will authored and asterite committed Jun 4, 2017
    Copy the full SHA
    32f583f View commit details
    Browse the repository at this point in the history