INFNAN(3)

NAME
infnan - deal with infinite or not-a-number (NaN) result

SYNOPSIS
#include <math.h>

double infnan(int error);

Link with -lm.

DESCRIPTION
The infnan() function returns a suitable value for infinity and "not-a-number" (NaN) results. The value of error can be ERANGE to represent infinity or anything else to represent NaN. errno is also set.

RETURN VALUE
If error is ERANGE (Infinity), HUGE_VAL is returned.

If error is -ERANGE (-Infinity), -HUGE_VAL is returned.

If error is anything else, NAN is returned.

ERRORS

EDOM
    The value of error is "not-a-number" (NaN).

ERANGE
    The value of error is positive or negative infinity.

CONFORMING TO
BSD 4.3