Bug 19124 – Investigate using RYU to convert floats to strings

Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-07-27T23:57:11Z
Last change time
2021-03-18T07:37:36Z
Assigned to
No Owner
Creator
Basile-z
See also
https://issues.dlang.org/show_bug.cgi?id=8424, https://issues.dlang.org/show_bug.cgi?id=18139

Comments

Comment #0 by b2.temp — 2018-07-27T23:57:11Z
Relying in the c standard library to do that is sometimes an issue. It's been encountered several time, e.g in std.json because snn.lib give different results that the gnu c library. It would also allow to get it to!string, format working at CTFE for float and double. Reference : https://github.com/ulfjack/ryu
Comment #1 by andre — 2018-07-28T19:42:28Z
I added your idea to the list of potential Symmetry Autumn of Code projects. Feel free to edit/enhance the text. https://wiki.dlang.org/SAOC_2018_ideas#Implementation_of_RYU_to_convert_floats_to_strings
Comment #2 by nick — 2018-12-27T12:41:26Z
> It would also allow to get it to!string, format working at CTFE > for float and double Stefan Koch has ported "a short and efficient implementation of the grisu2 algorithm" to CTFEable D code: https://forum.dlang.org/post/[email protected] He says "ryu however looks less fast for ctfe purposes": https://forum.dlang.org/post/[email protected]
Comment #3 by b2.temp — 2021-03-18T07:37:36Z
this has been investigated. The issue was not more specific than that.