A domain error occurs if x is negative and y is not an integral

a-domain-error-occurs-if-x-is-negative-and-y-is-not-an-integral

A domain error occurs if x is negative and y is not an integral value for the function pow(double x, double y).

A. true

B. false

This question was posed to me during a job interview.

Enquiry is from Mathematical functions in division C Library of C

The correct answer is A. true

Explanation: The pow() function computes x raised to the power y. A domain error occurs if x is negative and y is not an integral value. A domain error occurs if the result cannot be represented when x is zero and y is less than or equal to zero. A range error may occur.