JuliaLang/julia — pull request #7291 by quinnj (2014-06-17 20:24:22+00:00)
Title: WIP: Grisu

Implement grisu algorithm in native Julia. Fixes #5959. In particular, this creates a more Julian API to grisu in allowing any size float to be printed in its "shortest" form (while still being parsed back to the correct value), which is a surprisingly tricky problem ([link](http://www.sengupta.net/musings/2012/07/grisu/)).

Net code reduction is nice from 6K C++ to about 1K Julia. Initial performance benchmarks show it's just under 2x the native C++.

Marked WIP because I haven't actually removed the dependency on double-conversion yet, I was hoping to tap into the make-fu of @staticfloat perhaps (I should probably brush up on my makefile rules anyway...).

I would also appreciate someone testing this out on a 32-bit machine; I don't foresee any cross-platform issues, but some of the bit-twiddling may cause problems between 32/64-bit.