invalid(var V): int

Checks whether V is the result of an invalid expression.

Parameters:

V - var to be examined.

Returns:

0  - V is a valid number.
1  - V is invalid, for instance the square root of a negative number.
-1 - V is infinite, or instance the result of a division by zero.

Remarks:

Invalid numbers in an expression cause the result to become also invalid. 

Example:

if(invalid(Margin)) printf("\nCheck the Margin calculation!"); 

See also:

floor, ceil, abs

► latest version online