2 ms·
Validating the answer is different than providing it: FLOAT_EQ(sqrt(x) * sqrt(x), x) && sqrt(x)>=0.0 is a pretty good test for the square root even though
by praptak 10y ago
Validating the answer is different than providing it:
FLOAT_EQ(sqrt(x) * sqrt(x), x) && sqrt(x)>=0.0
is a pretty good test for the square root even though it doesn't compute it.