fdim.3m (2010 09)
f
fdim(3M) fdim(3M)
NAME
fdim( ), fdimf( ), fdiml( ), fdimw( ), fdimq( ) - positive difference functions
SYNOPSIS
#include <math.h>
double fdim(double x, double y);
HP Integrity Server Only
float fdimf(float x, float y);
long double fdiml(long double x, long double y);
extended fdimw(extended x, extended y);
quad fdimq(quad x, quad y);
DESCRIPTION
The fdim() function determines the positive difference between its arguments.
Integrity Server Only
fdimf() is a float version of fdim(); it takes
float arguments and returns a float result.
fdiml() is a long double version of fdim(); it takes long double arguments and returns a
long double result.
fdimw() is an extended version of fdim(); it takes extended arguments and returns an
extended result.
fdimq() is equivalent to fdiml() on HP-UX systems.
USAGE
To use this function, compile either with the default
-Ae option or with the -Aa
and -D_HPUX_SOURCE
options. To use (for Integrity servers) fdimw() or fdimq(), compile with the -fpwidetypes
option.
Make sure your program includes
<math.h>. Link in the math library by specifying -lm on the com-
piler or linker command line.
RETURN VALUE
The
fdim() function returns the positive difference between x and y .
If x
> y, fdim() returns x - y (and raises any exceptions resulting from the subtraction).
If x
<= y , fdim() returns +zero.
If x or y is NaN,
fdim() returns NaN.
If both arguments are NaNs,
fdim() returns NaN.
fdim() returns a positively signed infinity in lieu of a value whose magnitude is too large, and raises the
overflow and inexact exceptions.
ERRORS
No errors are defined.
SEE ALSO
fdim(3M), fmin(3M), math(5).
STANDARDS CONFORMANCE
fdim(), fdimf(), fdiml() : ISO/IEC C99 (including Annex F, ‘‘IEC 60559 floating-point arithmetic’’)
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1