www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1476] New: allow to use intrinsic math functions (e.g. trigonometry) in CTFEs

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1476

           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 digitalmars.com
        ReportedBy: thecybershadow 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.


-- 
Sep 05 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1476


thecybershadow gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE





gah... hand jerked while clicking "Submit"

*** This bug has been marked as a duplicate of 1475 ***


-- 
Sep 05 2007