Annoyance with new integer promotion deprecations

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Feb 7 00:12:39 UTC 2018


On Wed, Feb 07, 2018 at 12:10:14AM +0000, Adam D. Ruppe via Digitalmars-d wrote:
> On Wednesday, 7 February 2018 at 00:00:05 UTC, Nick Sabalausky (Abscissa)
> wrote:
> > //pragma(msg, 3.14159.text); // Ugh, ok, floats don't work though :(
> 
> So I saw a stb_sprintf with a from-scratch impl, including floats,
> public domain. Someone on IRC was thinking about porting it.
> 
> Maybe we should actually bring that in for the ctfe floats.

Formatting of floats, while apparently rather straightforward on the
surface, is in fact a hairy, monstrously complicated beast of a task,
with all sorts of lovely corner cases and special behaviours (as is
usual for IEEE floats, y'know, bread and butter, nothing surprising).
It's definitely not for the faint of heart to attempt to implement, and
is probably a big reason why Phobos just calls the C function to do the
job for us. :-P

Kudos in advance to whoever has the guts to reimplement it in D so that
we can use it in CTFE.


T

-- 
Political correctness: socially-sanctioned hypocrisy.


More information about the Digitalmars-d mailing list