News for hackers. Stuff that matters.
Re:Rendering floating numbers: advances in problems you didn... by est31 on Friday October 30, 2020 @01:25AM (#24939430)
Apparently Ryu is slower on shorter numbers than the Rust standard library's implementation which uses Grisu/Dragon. It might be only due to the implementation though. https://www.reddit.com/r/rust/comments/93d045/fast_floattost...

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-...

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.

* https://github.com/ClickHouse/ClickHouse/pull/8542

Re:Rendering floating numbers: advances in problems you didn... by zX41ZdbW on Friday October 30, 2020 @02:40AM (#24939744)