November 15, 2004 Contract example | ||||
---|---|---|---|---|
| ||||
Hi guys, i'm pretty new to D (wrote a simple Hello World), but ... shouldn't the out assert be more like (x * x) == result? long square_root(long x) in { assert(x >= 0); } out (result) { assert((result * result) == x); } body { return math.sqrt(x); } |
Copyright © 1999-2021 by the D Language Foundation