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           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
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

ATTRIBUTES

49       For  an  explanation  of  the  terms  used   in   this   section,   see
50       attributes(7).
51
52       ┌─────────────────────────┬───────────────┬─────────┐
53Interface                Attribute     Value   
54       ├─────────────────────────┼───────────────┼─────────┤
55fdim(), fdimf(), fdiml() │ Thread safety │ MT-Safe │
56       └─────────────────────────┴───────────────┴─────────┘

CONFORMING TO

58       C99, POSIX.1-2001, POSIX.1-2008.
59

SEE ALSO

61       fmax(3)
62

COLOPHON

64       This  page  is  part of release 4.16 of the Linux man-pages project.  A
65       description of the project, information about reporting bugs,  and  the
66       latest     version     of     this    page,    can    be    found    at
67       https://www.kernel.org/doc/man-pages/.
68
69
70
71                                  2017-09-15                           FDIM(3)
Impressum