1 .\" Copyright 2003 Walter Harms, Andries Brouwer
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
6 .\" Distributed under GPL
9 .TH FDIM 3 2020-06-09 "" "Linux Programmer's Manual"
11 fdim, fdimf, fdiml \- positive difference
16 .BI "double fdim(double " x ", double " y );
17 .BI "float fdimf(float " x ", float " y );
18 .BI "long double fdiml(long double " x ", long double " y );
24 Feature Test Macro Requirements for glibc (see
25 .BR feature_test_macros (7)):
31 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
34 These functions return the positive difference, max(\fIx\fP-\fIy\fP,0),
35 between their arguments.
37 On success, these functions return the positive difference.
43 is a NaN, a NaN is returned.
45 If the result overflows,
47 and the functions return
56 for information on how to determine whether an error has occurred
57 when calling these functions.
59 The following errors can occur:
61 Range error: result overflow
65 An overflow floating-point exception
69 These functions first appeared in glibc in version 2.1.
71 For an explanation of the terms used in this section, see
79 Interface Attribute Value
84 T} Thread safety MT-Safe
90 C99, POSIX.1-2001, POSIX.1-2008.
92 Before glibc version 2.24
93 .\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6796
94 on certain architectures (e.g., x86, but not x86_64)
95 these functions did not set