INF: Definition of a Domain Error

ID Number: Q37223

5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a

MS-DOS | OS/2

Summary:

In Microsoft C versions 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version 7.0, a

domain error occurs when you pass an invalid value to a function.

"Domain" refers to arguments to a function; "range" refers to the return

values.

For example, if you pass a -1 to sqrt(), you receive the math error

"M6201 Domain Error" because -1 is not in the domain of the square

root function (that is, you can't take the square root of -1).

This error also can occur if an incorrect type is passed to the

function. (For example, passing an int to a function that expects

double.) You should receive warnings in these cases if you have

declared proper function prototypes (perhaps by including the MATH.H

file).

Make sure the value you pass to a function is of the proper type and

the value is within that function's domain.

Additional reference words: 5.10 6.00 6.00a 6.00ax 7.00