← Back to index
|
Original Bugzilla link
Bug 3963 – out(result) in contract programming is nan
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-03-14T15:03:00Z
Last change time
2014-02-15T02:46:43Z
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2010-03-14T15:03:20Z
This program prints "nan" inside the out(result){} import std.stdio: writeln; double sqr(double x) out(result) { writeln("result1: ", result); // prints: result1: nan //assert(result >= 0); } body { return x * x; } void main() { writeln("result2: ", sqr(100)); // prints: result2: 10000 }
Comment #1
by clugdbug — 2010-03-15T00:55:49Z
*** This issue has been marked as a duplicate of issue 3667 ***