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():
20           _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE ||
21           _POSIX_C_SOURCE >= 200112L;
22           or cc -std=c99
23

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

VERSIONS

48       These functions first appeared in glibc in version 2.1.
49

ATTRIBUTES

51   Multithreading (see pthreads(7))
52       The fdim(), fdimf(), and fdiml() functions are thread-safe.
53

CONFORMING TO

55       C99, POSIX.1-2001.
56

SEE ALSO

58       fmax(3)
59

COLOPHON

61       This  page  is  part of release 3.53 of the Linux man-pages project.  A
62       description of the project, and information about reporting  bugs,  can
63       be found at http://www.kernel.org/doc/man-pages/.
64
65
66
67                                  2013-07-15                           FDIM(3)
Impressum