digitalmars.D - Contract example
- Serge Ratke (16/16) Nov 15 2004 Hi guys,
 
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);
}
 Nov 15 2004








 
 
 
 Serge Ratke <Serge_member pathlink.com>