[Issue 18630] std.math must CTFE

2019-09-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18630

Nathan S.  changed:

   What|Removed |Added

 Depends on|17705   |


Referenced Issues:

https://issues.dlang.org/show_bug.cgi?id=17705
[Issue 17705] std.math.isFinite cannot run at compile-time
--


[Issue 18630] std.math must CTFE

2019-09-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18630
Issue 18630 depends on issue 17705, which changed state.

Issue 17705 Summary: std.math.isFinite cannot run at compile-time
https://issues.dlang.org/show_bug.cgi?id=17705

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|WORKSFORME  |---

--


[Issue 18630] std.math must CTFE

2019-09-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18630

Nathan S.  changed:

   What|Removed |Added

 Depends on||17705


Referenced Issues:

https://issues.dlang.org/show_bug.cgi?id=17705
[Issue 17705] std.math.isFinite cannot run at compile-time
--


[Issue 18630] std.math must CTFE

2019-08-23 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18630

Nathan S.  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||n8sh.second...@hotmail.com
 Resolution|--- |DUPLICATE

--- Comment #5 from Nathan S.  ---
Marking this as a duplicate of #17007 since that one is older even though this
is the issue with discussion.

*** This issue has been marked as a duplicate of issue 17007 ***

--


[Issue 18630] std.math must CTFE

2019-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18630

Nicholas Wilson  changed:

   What|Removed |Added

 CC||iamthewilsona...@hotmail.co
   ||m

--- Comment #4 from Nicholas Wilson  ---
asin now works at compile time.

The rest still fail for the following reasons.

nextPow2  -- reinterpret
truncPow2 -- reinterpret
atan2 -- reinterpret
expi  -- asm
lround-- no avail source
lrint -- ditto
rndtol-- ditto
uantize   -- ditto
frexp -- reinterpret
ilogb -- y.vu[3] is used before initialised
scalbn-- asm

--


[Issue 18630] std.math must CTFE

2018-11-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18630

Simen Kjaeraas  changed:

   What|Removed |Added

 CC||simen.kja...@gmail.com

--- Comment #3 from Simen Kjaeraas  ---
(In reply to Eduard Staniloiu from comment #2)
> Maybe you can replace the static ctor with this idiom
> https://p0nce.github.io/d-idioms/#Precomputed-tables-at-compile-time-through-
> CTFE

That's exactly what he's trying to do. In 2.083.0, the following functions in
std.math are still not CTFE-able:

nextPow2
truncPow2
asin
atan2
expi
lround
lrint
rndtol
quantize
frexp
ilogb
scalbn

Getting there, though - in 2.081.1, the list was about twice as big.

--


[Issue 18630] std.math must CTFE

2018-11-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18630

--- Comment #2 from Eduard Staniloiu  ---
(In reply to Manu from comment #0)
> I usually workaround with a static constructor that pre-computes tables at
> startup, but that only solves some subset of cases. When I want those tables
> to interact with other CTFE code, I'm blocked.

Maybe you can replace the static ctor with this idiom
https://p0nce.github.io/d-idioms/#Precomputed-tables-at-compile-time-through-CTFE

--


[Issue 18630] std.math must CTFE

2018-11-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18630

Eduard Staniloiu  changed:

   What|Removed |Added

 CC||edi33...@gmail.com

--- Comment #1 from Eduard Staniloiu  ---
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) < .1);
```

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

--