NAME

SYNOPSIS

DESCRIPTION

The modf() and modff() functions break the argument x into integral and fractional parts, each of which has the same sign as the argument.
The modf() function stores the integral part as a double in the object pointed to by iptr. The modff() function stores the
integral part as a float in the object pointed to by iptr.

RETURN VALUES

Upon successful completion, modf() and modff() return the signed fractional part of x.

If x is NaN, NaN is returned and *iptr is set to NaN.

If the correct value would cause underflow to 0.0, modf() returns 0 and errno may be set to ERANGE.

ERRORS

The modf() function may fail if:

ERANGE

The result underflows.

USAGE

An application wishing to check for error situations should set errno to 0 before calling modf(). If errno is non-zero on return, or the return
value is NaN, an error has occurred.