now it's possible! printing floating point numbers at compile-time
Stefan Koch
uplink.coder at googlemail.com
Sat Dec 22 20:08:12 UTC 2018
Hi Guys,
during my research on floating point numbers I came across a
short and efficient implementation[0] of the grisu2 algorithm for
converting floating point numbers into strings.
Which I then ported into CTFEable D code.
Thus enabling you to convert doubles into strings at compiletime.
Cheers
Stefan Koch
P.S. You can find it at my fork of fpconv[1].
[0] https://github.com/night-shift/fpconv
[1]
https://github.com/UplinkCoder/fpconv/blob/master/src/fpconv_ctfe.d
More information about the Digitalmars-d-announce
mailing list