Debian Codegraph @

upstream/debian-unstable/man3/fmax.3

raw
1 '\" t
2 .\" Copyright 2002, Walter Harms <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: GPL-1.0-or-later
6 .\"
7 .TH fmax 3 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 fmax, fmaxf, fmaxl \- determine maximum of two floating-point numbers
10 .SH LIBRARY
11 Math library
12 .RI ( libm ,\~ \-lm )
13 .SH SYNOPSIS
14 .nf
15 .B #include <math.h>
16 .P
17 .BI "double fmax(double " x ", double " y );
18 .BI "float fmaxf(float " x ", float " y );
19 .BI "long double fmaxl(long double " x ", long double " y );
20 .fi
21 .P
22 .RS -4
23 Feature Test Macro Requirements for glibc (see
24 .BR feature_test_macros (7)):
25 .RE
26 .P
27 .BR fmax (),
28 .BR fmaxf (),
29 .BR fmaxl ():
30 .nf
31 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
32 .fi
33 .SH DESCRIPTION
34 These functions return the larger value of
35 .I x
36 and
37 .IR y .
38 .SH RETURN VALUE
39 These functions return the maximum of
40 .I x
41 and
42 .IR y .
43 .P
44 If one argument is a NaN, the other argument is returned.
45 .P
46 If both arguments are NaN, a NaN is returned.
47 .SH ERRORS
48 No errors occur.
49 .SH ATTRIBUTES
50 For an explanation of the terms used in this section, see
51 .BR attributes (7).
52 .TS
53 allbox;
54 lbx lb lb
55 l l l.
56 Interface Attribute Value
57 T{
58 .na
59 .nh
60 .BR fmax (),
61 .BR fmaxf (),
62 .BR fmaxl ()
63 T} Thread safety MT-Safe
64 .TE
65 .SH STANDARDS
66 C11, POSIX.1-2008.
67 .SH HISTORY
68 glibc 2.1.
69 C99, POSIX.1-2001.
70 .SH SEE ALSO
71 .BR fdim (3),
72 .BR fmin (3)