[dmd-internals] Pure CTFE-able std.math

Daniel Murphy yebblies at gmail.com
Mon Jul 15 07:04:08 PDT 2013


I would prefer to see (as either builtins or properties) a way to get/set
the exponent/mantissa/sign of a float.

eg
float x;
x.sign = 1;
assert(x.exp == 123);

Easily ctfeable, no need for casting, no endianness problems.

I expect everything could be implemented from these?


On Mon, Jul 15, 2013 at 8:22 PM, Iain Buclaw <ibuclaw at ubuntu.com> wrote:

> On 15 July 2013 10:46, Iain Buclaw <ibuclaw at ubuntu.com> wrote:
> >
> > Now, the pressing question is, which method do you prefer / would like
> > to see in CTFE first. :o)
> >
>
> Alternatively, we could add BUILTINfloor and BUILTINceil into
> builtins.c, but I'd rather avoid this route if possible. :-)
>
> --
> Iain Buclaw
>
> *(p < e ? p++ : p) = (c & 0x0f) + '0';
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20130716/9c68da38/attachment.html>


More information about the dmd-internals mailing list