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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 5 13:05:10 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1475

           Summary: allow to use intrinsic math functions (e.g.
                    trigonometry) in CTFEs
           Product: D
           Version: 1.021
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thecybershadow at gmail.com


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.


-- 



More information about the Digitalmars-d-bugs mailing list