[Issue 1883] New: templates instantiated as real gives incorrect values

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 29 07:18:47 PST 2008


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

           Summary: templates instantiated as real gives incorrect values
           Product: D
           Version: 2.011
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: diboss at hotmail.com


Here's a simplified example:

template factorial(real n) {
     const real factorial = 1;
}

void main() {
     writefln(factorial!(5));
}

outputs: -0 instead of 1.
This is different than behaviour in 1.027.


-- 



More information about the Digitalmars-d-bugs mailing list