CTFE pow()

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu Jan 1 10:40:58 PST 2015


On Fri, Jan 02, 2015 at 02:56:16AM +1000, Manu via Digitalmars-d wrote:
> Does anyone know how to fix this? Can we please do so? It's been a
> problem for like 5 years it seems.
> It's a bit insane that we can't resolve any non-linear functions at
> compile time.

I've been waiting for this since like, forever. We even have a D code
implementation of pow() already (thanks to Iain), which *should* have
been CTFE-able, if it weren't for CTFE limitations that prohibit
reinterpreting float values in binary, which is required for certain
basic operations like isInfinite, isNaN, etc..

So it seems that the blocker right now is CTFE, which, unfortunately, is
not a pretty piece of code, and requires quite a bit of care to get it
done right.


T

-- 
I am Ohm of Borg. Resistance is voltage over current.


More information about the Digitalmars-d mailing list