]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/fdim.3
libc.7: Add a note on why glibc 2.x uses the soname libc.so.6
[thirdparty/man-pages.git] / man3 / fdim.3
1 .\" Copyright 2003 Walter Harms, Andries Brouwer
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
6 .\" Distributed under GPL
7 .\" %%%LICENSE_END
8 .\"
9 .TH FDIM 3 2016-03-15 "" "Linux Programmer's Manual"
10 .SH NAME
11 fdim, fdimf, fdiml \- positive difference
12 .SH SYNOPSIS
13 .B #include <math.h>
14 .sp
15 .BI "double fdim(double " x ", double " y );
16 .br
17 .BI "float fdimf(float " x ", float " y );
18 .br
19 .BI "long double fdiml(long double " x ", long double " y );
20 .sp
21 Link with \fI\-lm\fP.
22 .sp
23 .in -4n
24 Feature Test Macro Requirements for glibc (see
25 .BR feature_test_macros (7)):
26 .in
27 .sp
28 .ad l
29 .BR fdimf (),
30 .BR fdiml ():
31 .RS 4
32 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
33 .RE
34 .ad
35 .SH DESCRIPTION
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.
40
41 If
42 .I x
43 or
44 .I y
45 is a NaN, a NaN is returned.
46
47 If the result overflows,
48 a range error occurs,
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
75 .SH VERSIONS
76 These functions first appeared in glibc in version 2.1.
77 .SH ATTRIBUTES
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{
86 .BR fdim (),
87 .BR fdimf (),
88 .BR fdiml ()
89 T} Thread safety MT-Safe
90 .TE
91 .SH CONFORMING TO
92 C99, POSIX.1-2001, POSIX.1-2008.
93 .SH SEE ALSO
94 .BR fmax (3)