]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2003 Walter Harms, Andries Brouwer |
a637b728 MK |
2 | .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk |
3 | .\" <mtk.manpages@gmail.com> | |
2297bf0e | 4 | .\" |
38f20bb9 | 5 | .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) |
b18188c5 | 6 | .\" Distributed under GPL |
38f20bb9 | 7 | .\" %%%LICENSE_END |
fea681da | 8 | .\" |
97986708 | 9 | .TH FDIM 3 2016-03-15 "" "Linux Programmer's Manual" |
fea681da MK |
10 | .SH NAME |
11 | fdim, fdimf, fdiml \- positive difference | |
12 | .SH SYNOPSIS | |
13 | .B #include <math.h> | |
68e4db0a | 14 | .PP |
fea681da | 15 | .BI "double fdim(double " x ", double " y ); |
d39541ec | 16 | .br |
fea681da | 17 | .BI "float fdimf(float " x ", float " y ); |
d39541ec | 18 | .br |
fea681da | 19 | .BI "long double fdiml(long double " x ", long double " y ); |
68e4db0a | 20 | .PP |
a637b728 | 21 | Link with \fI\-lm\fP. |
68e4db0a | 22 | .PP |
a637b728 MK |
23 | .in -4n |
24 | Feature Test Macro Requirements for glibc (see | |
25 | .BR feature_test_macros (7)): | |
26 | .in | |
68e4db0a | 27 | .PP |
a637b728 MK |
28 | .ad l |
29 | .BR fdimf (), | |
30 | .BR fdiml (): | |
f1f0e4ed | 31 | .RS 4 |
e464f054 | 32 | _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L |
f1f0e4ed MK |
33 | .RE |
34 | .ad | |
fea681da | 35 | .SH DESCRIPTION |
a637b728 MK |
36 | These functions return the positive difference, max(\fIx\fP-\fIy\fP,0), |
37 | between their arguments. | |
38 | .SH RETURN VALUE | |
39 | On success, these functions return the positive difference. | |
847e0d88 | 40 | .PP |
fea681da MK |
41 | If |
42 | .I x | |
43 | or | |
44 | .I y | |
a637b728 | 45 | is a NaN, a NaN is returned. |
847e0d88 | 46 | .PP |
a637b728 | 47 | If the result overflows, |
efe294cb | 48 | a range error occurs, |
a637b728 MK |
49 | and the functions return |
50 | .BR HUGE_VAL , | |
51 | .BR HUGE_VALF , | |
52 | or | |
53 | .BR HUGE_VALL , | |
54 | respectively. | |
55 | .SH ERRORS | |
56 | See | |
57 | .BR math_error (7) | |
58 | for information on how to determine whether an error has occurred | |
59 | when calling these functions. | |
60 | .PP | |
61 | The following errors can occur: | |
62 | .TP | |
63 | Range error: result overflow | |
64 | .\" .I errno | |
65 | .\" is set to | |
66 | .\" .BR ERANGE . | |
67 | An overflow floating-point exception | |
68 | .RB ( FE_OVERFLOW ) | |
69 | is raised. | |
70 | .PP | |
71 | These functions do not set | |
72 | .IR errno . | |
73 | .\" FIXME . Is it intentional that these functions do not set errno? | |
74 | .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6796 | |
f0d7ce1d MK |
75 | .SH VERSIONS |
76 | These functions first appeared in glibc in version 2.1. | |
be988392 | 77 | .SH ATTRIBUTES |
9a81a874 MK |
78 | For an explanation of the terms used in this section, see |
79 | .BR attributes (7). | |
80 | .TS | |
81 | allbox; | |
82 | lbw24 lb lb | |
83 | l l l. | |
84 | Interface Attribute Value | |
85 | T{ | |
be988392 PH |
86 | .BR fdim (), |
87 | .BR fdimf (), | |
be988392 | 88 | .BR fdiml () |
9a81a874 MK |
89 | T} Thread safety MT-Safe |
90 | .TE | |
47297adb | 91 | .SH CONFORMING TO |
9a74e018 | 92 | C99, POSIX.1-2001, POSIX.1-2008. |
47297adb | 93 | .SH SEE ALSO |
fea681da | 94 | .BR fmax (3) |