xref: /freebsd/lib/msun/man/fmaximum_mag.3 (revision f62d826a6f5b9022b0cedfe22a698998ad9cb7f4)
1.\" Copyright (c) 2004 David Schultz <das@FreeBSD.org>
2.\" Copyright (c) 2026 Jesús Blázquez <jesuscblazquez@gmail.com>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.Dd April 3, 2026
27.Dt FMAXIMUM_MAG 3
28.Os
29.Sh NAME
30.Nm fmaximum_mag ,
31.Nm fmaximum_magf ,
32.Nm fmaximum_magl ,
33.Nm fminimum_mag ,
34.Nm fminimum_magf ,
35.Nm fminimum_magl
36.Nd floating-point maximum and minimum magnitude functions
37.Sh LIBRARY
38.Lb libm
39.Sh SYNOPSIS
40.In math.h
41.Ft double
42.Fn fmaximum_mag "double x" "double y"
43.Ft float
44.Fn fmaximum_magf "float x" "float y"
45.Ft "long double"
46.Fn fmaximum_magl "long double x" "long double y"
47.Ft double
48.Fn fminimum_mag "double x" "double y"
49.Ft float
50.Fn fminimum_magf "float x" "float y"
51.Ft "long double"
52.Fn fminimum_magl "long double x" "long double y"
53.Sh DESCRIPTION
54The
55.Fn fmaximum_mag ,
56.Fn fmaximum_magf ,
57and
58.Fn fmaximum_magl
59functions determine the larger of the absolute values of
60.Fa x
61and
62.Fa y ,
63and return the argument with the larger absolute value.
64If the absolute values are equal, the behavior is equivalent to calling the corresponding
65.Fn fmaximum
66function on the arguments.
67.Pp
68Likewise, the
69.Fn fminimum_mag ,
70.Fn fminimum_magf ,
71and
72.Fn fminimum_magl
73functions determine the smaller of the absolute values of
74.Fa x
75and
76.Fa y ,
77and return the argument with the smaller absolute value.
78If the absolute values are equal, the behavior is equivalent to calling the corresponding
79.Fn fminimum
80function on the arguments.
81.Pp
82If either argument is an \*(Na, then the result is an \*(Na.
83These routines do not raise any floating-point exceptions.
84.Sh SEE ALSO
85.Xr fmax 3 ,
86.Xr fmaximum 3 ,
87.Xr fmaximum_mag_num 3 ,
88.Xr math 3
89.Sh STANDARDS
90The
91.Fn fmaximum_mag ,
92.Fn fmaximum_magf ,
93.Fn fmaximum_magl ,
94.Fn fminimum_mag ,
95.Fn fminimum_magf ,
96and
97.Fn fminimum_magl
98functions conform to
99.St -isoC-2023 .
100.Sh HISTORY
101These routines first appeared in
102.Fx 16.0 .
103