Next: floor, Previous: fabs, Up: Math [Contents][Index]

### 1.20 `fdim`, `fdimf`—positive difference

Synopsis

    #include <math.h>
    double fdim(double x, double y);
    float fdimf(float x, float y);

Description
The `fdim` functions determine the positive difference between their arguments, returning:

    	x - y	if x > y, or

    	+0	if x <= y, or

    	NAN	if either argument is NAN.

A range error may occur.

Returns
The `fdim` functions return the positive difference value.

Portability
ANSI C, POSIX.