double fdim (double x , double y); float fdimf (float x , float y); long double fdiml (long double x, long double y);
double fdim (double x , double y); float fdim (float x , float y); long double fdim (long double x, long double y); double fdim (Type1 x , Type2 y); // additional overloads
x-y
if x>y
, and zero otherwise.<cmath>
) for other combinations of arithmetic types (Type1 and Type2): These overloads effectively cast its arguments to double
before calculations, except if at least one of the arguments is of type long double
(in which case both are casted to long double
instead).
|
|
fdim (2.0, 1.0) = 1.000000 fdim (1.0, 2.0) = 0.000000 fdim (-2.0,-1.0) = 0.000000 fdim (-1.0,-2.0) = 1.000000 |