now it's possible! printing floating point numbers at compile-time
b2.temp at gmx.com
Sat Dec 22 21:06:48 UTC 2018
On Saturday, 22 December 2018 at 20:24:46 UTC, Stefan Koch wrote:
> On Saturday, 22 December 2018 at 20:08:12 UTC, Stefan Koch
>> Thus enabling you to convert doubles into strings at
Cool, CTFE formating is something that occasionaly comes in the
forum. Now i remember there's also RYU  that could have worked
> Aww .... I am dumb ... should have waited 2 days :)
No because actually from a pagan point of view the big thing was
yesterday night (solstice).
> Anyhow I hope that this is helpful to some of you.
> Please note that grisu 2 will give you representation which
> will convert into the same(!) floatingpoint number you passed
> in >92% of all possible inputs.
> Meaning you can round trip from string to double without loss
> of bits, for very many number but not all of them, that said
> the accuracy in general should be better than what a usual
> sprintf would give you.
> Cheers and Merry Christmas,
More information about the Digitalmars-d-announce