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 section below regarding ways to mitigate the effects of a range error).

Code Block
bgColor#ffcccc
double x, y, result;

if (((x == 0.f) && islessequal(y, 0)) ||
    (isless(x, 0) && !isInteger(y))) {
  /* handle domain and range errors */
}

result = pow(x, y);

...