[Issue 1475] allow to use intrinsic math functions (e.g. trigonometry) in CTFEs

Sean Kelly sean at f4.ca
Wed Sep 5 15:18:41 PDT 2007


d-bugmail at puremagic.com wrote:
>
> ------- Comment #2 from wbaxter at gmail.com  2007-09-05 16:10 -------
> Of course you can already do this by writing your own CTFE functions to
> approximate those via Taylor series and the like.  One of the first CTFE demos
> was a compile-time sqrt function.
> 
> But yeh, the compiler has access to a better way to evaluate those functions
> than running what amounts to an interpreted language, so it would be nice to be
> able to access it.

It was my impression that CTFE relies on a fancy version of constant 
folding, which doesn't make support for any special routines or plugins 
a really natural fit.  And while it seems like a potentially interesting 
feature to add, I wonder whether there might be issues related to cross 
compilation.


More information about the Digitalmars-d-bugs mailing list