Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

fdim, fdimf, fdiml - compute positive difference

&pagelevel(4)&pagelevel

Syntax

#include <math.h>

C11
double fdim(double x, double y);
float fdimf(float x, float y);
long double fdiml(long double x, long double y); (End)

Description

These functions compute the positive difference between the floating-point numbers x and y.

Return val.

x - y                   if x > y, f successful

0                        if x <= y, f successful

HUGE_VAL/HUGE_VALF/HUGE_VALL

                          depending on the function type, if an overflow occurs.

                          errno is set to indicate the error.

Errors

fdim(), fdimf() and fdiml() will fail if:

ERANGE            Overflow; the return value is too high.

See also

fmax(), fmin(), math.h.