You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Print floats with the shortest digits that round-trip #93
Float-to-string tries 15, 16 and 17 significant digits until the value reads back, which round-trips but is not always the shortest form: the smallest denormal prints 4.94065645841247e-324 (shortest: 5e-324), and large integral values use exponent form earlier than JS (1e+16 vs 10000000000000000). C++17 std::to_chars(double) gives the shortest round-trip digits on MSVC, libstdc++ and libc++, without a new dependency; the current loop can stay as the fallback where it is unavailable. The exponent and integer formatting rules Haxe code relies on (Std.string, string interpolation, Json) should stay as they are apart from the digit count.
Activity
Print Floats with the shortest digits that read back