ulfjack/ryu
View on GitHub ↗ ★ 1,359 C++
Converts floating point numbers to decimal strings
21 mentions on Hacker News by 17 people: 5 stories, 16 comments · first 2018-07-28 · latest 2025-09-12
20082026
-
…to do the float->string conversion are quite complicated. Here is a recent pretty good one: https://github.com/ulfjack/ryu I think there's been an even more recent one that is even more efficient than Ryu but I don't remember the name.
comment by IshKebab · 2025-09-12 · in Float Exposed -
…(arbitrarily capped at 18 digits because Ryu didn't need more) [1]: https://github.com/ulfjack/ryu/issues/34
comment by dzaima · 2025-01-08 · in Optimizing uint64_t Digit Counting: A Method that Beats Lemire's by up to 143% -
…also uses a novel algorithm which is an order of magnitude quicker for many floating points tasks ( https://github.com/ulfjack/ryu ). If you actually want to learn about this, then watch the video I linked earlier.
comment by deeringc · 2024-10-14 · in C++ String Conversion: Exploring std:from_chars in C++17 to C++26 -
There's also the new Ryu algorithm that is being used, which is probably the biggest speed up. https://github.com/ulfjack/ryu
comment by deeringc · 2024-10-14 · in C++ String Conversion: Exploring std:from_chars in C++17 to C++26 -
…engineering effort into "Ryu", a parsing library for double-precision floating point numbers: https://github.com/ulfjack/ryu It's not a parsing library, but a printing one, i.e., double -> string. https://github.com/fastfloat/fast_float is…
comment by fuklief · 2023-04-04 · in Parquet: An efficient, binary file format for table data -
…engineering effort into "Ryu", a parsing library for double-precision floating point numbers: https://github.com/ulfjack/ryu Why bother, you ask? Why would anyone bother to make floating point number parsing super efficient? JSON.
comment by jiggawatts · 2023-04-04 · in Parquet: An efficient, binary file format for table data -
…know if it ever prints more digits than needed. One recent algorithm for printing floats exactly is https://github.com/ulfjack/ryu , though I'm unaware what's the state-of-the-art ( https://github.com/jk-jeon/dragonbox claims to be a…
comment by nyanpasu64 · 2022-08-03 · in I still love PHP and JavaScript -
…the converse (doubles to strings), is also much faster than using Java's number formatting classes. https://github.com/ulfjack/ryu/blob/master/src/main/java/inf... Aside, my JMathTeX fork uses Ryū to achieve real-time rendering of TeX in…
comment by thangalin · 2021-03-22 · in FastDoubleParser: Java port of Daniel Lemires fast_double_parser -
…fork) [2]: https://bell-sw.com/announcements/2020/11/02/TeXnical-Writin... (my blog series) [3]: https://github.com/ulfjack/ryu [4]: https://github.com/DaveJarvis/JMathTeX/blob/d2d678717505765b...
comment by thangalin · 2021-02-12 · in SVG: The Good, the Bad and the Ugly -
…fastest algorithm at this point: https://dl.acm.org/doi/10.1145/3192366.3192369 (PLDI 2018 paper) https://github.com/ulfjack/ryu (C source code)
comment by jcranmer · 2020-10-30 · in Rendering floating numbers: advances in problems you didn’t know you had (2011) -
…even more recent research into doing this really efficiently, using an algorithm called Ryū. [e] https://github.com/ulfjack/ryu [-4] https://www.youtube.com/watch?v=kw-U6smcLzk [1.73] https://www.youtube.com/watch?v=4P_kbF0EbZM
comment by ygra · 2020-09-29 · in Floating Point in the Browser, Part 1: Impossible Expectations -
…as strings into individual SVG documents in under 600 milliseconds on newish hardware. [0]: https://github.com/ulfjack/ryu/blob/master/README.md [1]: https://news.ycombinator.com/item?id=17633182 [2]: https://github.com/DaveJarvis/JMathTeX/…
comment by thangalin · 2020-09-11 · in Parsing floats in C++: benchmarking strtod vs. from_chars -
…Look at Ryu for example. Good luck understanding that without comments or documentation: https://github.com/ulfjack/ryu/blob/master/ryu/f2s.c
comment by IshKebab · 2018-10-07 · in Writing system software: code comments -
To save some time: https://github.com/ulfjack/ryu
comment by ur-whale · 2018-07-28 · in Ryū: Fast Float-To-String Conversion -
C code for Ryu is available under the Apache2 and Boost licenses: https://github.com/ulfjack/ryu/tree/master/ryu Also have a look at Grisu3, Dragon4, dtoa, and the printf implementations of glibc and musl.
comment by nwellnhof · 2018-07-28 · in Ryū: Fast Float-To-String Conversion -
The code is here: https://github.com/ulfjack/ryu
comment by bratao · 2018-07-28 · in Ryū: Fast Float-To-String Conversion