...
This code only performs bounds-checking on x
and y
. It prevents domain errors and some range errors, but does not prevent range errors where the result cannot be represented as a double
(see the Error Checking and Detection section below regarding ways to mitigate the effects of a range error).
...
Code Block | ||
---|---|---|
| ||
double x; double result; if (isless(x, 0)){ /* handle domain error */ } result = sqrt(x); |
Anchor | ||||
---|---|---|---|---|
|
Error Checking and Detection
...