[Issue 18630] std.math must CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 29 14:02:42 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18630

Eduard Staniloiu <edi33416 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |edi33416 at gmail.com

--- Comment #1 from Eduard Staniloiu <edi33416 at gmail.com> ---
I think they already are, but I could be wrong.

Did you try forcing the compile time evaluation?
I had no problem running the following

```
enum r = pow(2.0, 5);
static assert(r == 32.0);

static assert(log(E) == 1);

enum f = sin(-2.0f);
static assert(fabs(f -  -0.909297f) < .00001);
```

Those are all altered unittests from std.math, to which I added `enum varName`
and `static assert` instead of `assert`

--


More information about the Digitalmars-d-bugs mailing list