Bug 1883 – templates instantiated as real gives incorrect values
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P5
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-02-29T09:18:00Z
Last change time
2015-06-09T01:14:35Z
Assigned to
andrei
Creator
diboss
Comments
Comment #0 by diboss — 2008-02-29T09:18:46Z
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.