1FDIM(3)                    Linux Programmer's Manual                   FDIM(3)
2
3
4

NAME

6       fdim, fdimf, fdiml - positive difference
7

SYNOPSIS

9       #include <math.h>
10
11       double fdim(double x, double y);
12       float fdimf(float x, float y);
13       long double fdiml(long double x, long double y);
14
15       Link with -lm.
16
17   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19       fdimf(), fdiml(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or
20       cc -std=c99
21

DESCRIPTION

23       These functions return the  positive  difference,  max(x-y,0),  between
24       their arguments.
25

RETURN VALUE

27       On success, these functions return the positive difference.
28
29       If x or y is a NaN, a NaN is returned.
30
31       If the result overflows, a range error occurs, and the functions return
32       HUGE_VAL, HUGE_VALF, or HUGE_VALL, respectively.
33

ERRORS

35       See math_error(7) for information on how to determine whether an  error
36       has occurred when calling these functions.
37
38       The following errors can occur:
39
40       Range error: result overflow
41              An overflow floating-point exception (FE_OVERFLOW) is raised.
42
43       These functions do not set errno.
44

VERSIONS

46       These functions first appeared in glibc in version 2.1.
47

CONFORMING TO

49       C99, POSIX.1-2001.
50

SEE ALSO

52       fmax(3)
53

COLOPHON

55       This  page  is  part of release 3.22 of the Linux man-pages project.  A
56       description of the project, and information about reporting  bugs,  can
57       be found at http://www.kernel.org/doc/man-pages/.
58
59
60
61                                  2008-08-11                           FDIM(3)
Impressum