Issue 17007 - let std.math work in CTFE
Summary: let std.math work in CTFE
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
: 18630 (view as issue list)
Depends on: 20197 17705 20159 20192 20196 20198 20199 20200 20202 20203 21407 21408
Blocks:
  Show dependency treegraph
 
Reported: 2016-12-22 16:32 UTC by Seb
Modified: 2024-12-01 16:28 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Seb 2016-12-22 16:32:58 UTC
(There's a lot of custom assembler code)

So there are already community-driven projects out there, e.g. https://code.dlang.org/packages/ctstdmath
Comment 1 Nathan S. 2019-08-23 21:51:52 UTC
*** Issue 18630 has been marked as a duplicate of this issue. ***
Comment 2 Simen Kjaeraas 2019-08-26 08:23:20 UTC
These functions currently fail in CTFE:

nextPow2/truncPow2: reinterpreting as ushort. (both call same function)
nextDown/nextUp/nextafter: reinterpreting as ulong.
lrint:         inline assembly.
ilogb:         reinterpreting in union.
cmp:           reinterpreting in union.
frexp:         reinterpreting as ushort, int and/or long.
feqrel:        reinterpreting as ushort.
isNormal:      reinterpreting as ushort.
isPowerOf2:    reinterpreting as ushort. 
NaN:           reinterpreting as ulong.
getNaNPayload: reinterpreting as ulong.
isIdentical:   reinterpreting as long.
isSubnormal:   reinterpreting as uint.
atan/atan2:    reinterpreting as ubyte. (both call same function)
signbit:       reinterpreting as ubyte.
remainder:     intrinsic.
cbrt:          intrinsic.
fmod:          intrinsic.
modf:          intrinsic.
logb:          intrinsic.
nearbyint:     intrinsic.
rint:          intrinsic.
rndtol:        intrinsic.
lround:        intrinsic.

expi:          inline assembly. This function is deprecated.
quantize:      depends on rint by default, works with other rounding functions.
Comment 3 dlangBugzillaToGithub 2024-12-01 16:28:39 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/10217

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB