Re:Rendering floating numbers: advances in problems you didn...
by StephanTLavavej on Friday October 30, 2020 @01:57AM
(#24939577)
That “weirdness” is just scientific notation, which the Ryu implementation always emits. It is “superficial” in the sense that it’s separate from the core algorithm. When I adapted it for C++17 charconv in MSVC, I implemented fixed, general, and “plain shortest” notation, which will print 0.3 there. (General notation follows C printf %g’s rules for switching between fixed and scientific; “plain shortest” notation selects the one that’s fewer characters, tiebreaking to prefer fixed).
Re:Rendering floating numbers: advances in problems you didn...
by zX41ZdbW on Friday October 30, 2020 @02:37AM
(#24939732)
In ClickHouse* we patched Ryu to provide nicer representations and to have better performance for floats that appear to be integers.
Re:Rendering floating numbers: advances in problems you didn...
by zX41ZdbW on Friday October 30, 2020 @02:40AM
(#24939744)
The change to Ryu is here: https://github.com/ClickHouse-Extras/ryu/pull/1
Also it seems that Ryu prints some numbers in weird ways even though "nicer" representations exist: https://github.com/rust-lang/rust/issues/52811#issuecomment-...