Bug 1476 – allow to use intrinsic math functions (e.g. trigonometry) in CTFEs
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-09-05T15:05:00Z
Last change time
2014-02-17T22:50:11Z
Assigned to
bugzilla
Creator
dlang-bugzilla
Comments
Comment #0 by dlang-bugzilla — 2007-09-05T15:05:09Z
The compiler already supports some math functions, like the trigonometric ones, as intrinsics, since it inlines them even when -inline is not specified. It would greatly add to CTFEs if it were possible to call such functions in compile-time functions. For example, Pi could be calculated at compile-time using:
const double PI = atan(1)*4;
Sine tables could also be pre-calculated at compile time, etcetera.
Comment #1 by dlang-bugzilla — 2007-09-05T15:06:22Z
gah... hand jerked while clicking "Submit"
*** This bug has been marked as a duplicate of 1475 ***