]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fdim.3
Changes: Ready for 4.13
[thirdparty/man-pages.git] / man3 / fdim.3
CommitLineData
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
11fdim, 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 21Link with \fI\-lm\fP.
68e4db0a 22.PP
a637b728
MK
23.in -4n
24Feature 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
36These functions return the positive difference, max(\fIx\fP-\fIy\fP,0),
37between their arguments.
38.SH RETURN VALUE
39On success, these functions return the positive difference.
847e0d88 40.PP
fea681da
MK
41If
42.I x
43or
44.I y
a637b728 45is a NaN, a NaN is returned.
847e0d88 46.PP
a637b728 47If the result overflows,
efe294cb 48a range error occurs,
a637b728
MK
49and the functions return
50.BR HUGE_VAL ,
51.BR HUGE_VALF ,
52or
53.BR HUGE_VALL ,
54respectively.
55.SH ERRORS
56See
57.BR math_error (7)
58for information on how to determine whether an error has occurred
59when calling these functions.
60.PP
61The following errors can occur:
62.TP
63Range error: result overflow
64.\" .I errno
65.\" is set to
66.\" .BR ERANGE .
67An overflow floating-point exception
68.RB ( FE_OVERFLOW )
69is raised.
70.PP
71These 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
76These functions first appeared in glibc in version 2.1.
be988392 77.SH ATTRIBUTES
9a81a874
MK
78For an explanation of the terms used in this section, see
79.BR attributes (7).
80.TS
81allbox;
82lbw24 lb lb
83l l l.
84Interface Attribute Value
85T{
be988392
PH
86.BR fdim (),
87.BR fdimf (),
be988392 88.BR fdiml ()
9a81a874
MK
89T} Thread safety MT-Safe
90.TE
47297adb 91.SH CONFORMING TO
9a74e018 92C99, POSIX.1-2001, POSIX.1-2008.
47297adb 93.SH SEE ALSO
fea681da 94.BR fmax (3)