Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
bgColor#ccccff
double x;
double result;

if (isless(x, 0)){
  /* handle domain error */
}

result = sqrt(x);

Anchor
Error Checking and Detection
Error Checking and Detection

Error Checking and Detection

...