1 .\" Copyright 2003 Walter Harms, Andries Brouwer
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: GPL-1.0-or-later
7 .TH FDIM 3 2021-03-22 "" "Linux Programmer's Manual"
9 fdim, fdimf, fdiml \- positive difference
12 .RI ( libm ", " \-lm )
17 .BI "double fdim(double " x ", double " y );
18 .BI "float fdimf(float " x ", float " y );
19 .BI "long double fdiml(long double " x ", long double " y );
23 Feature Test Macro Requirements for glibc (see
24 .BR feature_test_macros (7)):
30 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
33 These functions return the positive difference, max(\fIx\fP-\fIy\fP,0),
34 between their arguments.
36 On success, these functions return the positive difference.
42 is a NaN, a NaN is returned.
44 If the result overflows,
46 and the functions return
55 for information on how to determine whether an error has occurred
56 when calling these functions.
58 The following errors can occur:
60 Range error: result overflow
64 An overflow floating-point exception
68 These functions first appeared in glibc in version 2.1.
70 For an explanation of the terms used in this section, see
78 Interface Attribute Value
83 T} Thread safety MT-Safe
89 C99, POSIX.1-2001, POSIX.1-2008.
91 Before glibc version 2.24
92 .\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6796
93 on certain architectures (e.g., x86, but not x86_64)
94 these functions did not set