CTFE pow()

Dominikus Dittes Scherkl via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 2 14:20:16 PST 2015


On Friday, 2 January 2015 at 13:33:40 UTC, Don wrote:

> BTW in the existing CTFE you can cast int <-> float and long 
> <-> double.
>
> So you can implement pow for 64 bit floats already. It's only 
> 80-bit reals that are a problem, because there is no integer 
> type that is large enough.
Why?
long has 64 bit, which is enough to represent the mantissa of 
80bit reals. So you need only an additional short to hold the 
exponent.


More information about the Digitalmars-d mailing list