xref: /freebsd/lib/msun/man/fmaximum_mag_num.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.Dd April 3, 2026
26.Dt FMAXIMUM_MAG_NUM 3
27.Os
28.Sh NAME
29.Nm fmaximum_mag_num ,
30.Nm fmaximum_mag_numf ,
31.Nm fmaximum_mag_numl ,
32.Nm fminimum_mag_num ,
33.Nm fminimum_mag_numf ,
34.Nm fminimum_mag_numl
35.Nd floating-point maximum and minimum magnitude number functions
36.Sh LIBRARY
37.Lb libm
38.Sh SYNOPSIS
39.In math.h
40.Ft double
41.Fn fmaximum_mag_num "double x" "double y"
42.Ft float
43.Fn fmaximum_mag_numf "float x" "float y"
44.Ft "long double"
45.Fn fmaximum_mag_numl "long double x" "long double y"
46.Ft double
47.Fn fminimum_mag_num "double x" "double y"
48.Ft float
49.Fn fminimum_mag_numf "float x" "float y"
50.Ft "long double"
51.Fn fminimum_mag_numl "long double x" "long double y"
52.Sh DESCRIPTION
53The
54.Fn fmaximum_mag_num ,
55.Fn fmaximum_mag_numf ,
56and
57.Fn fmaximum_mag_numl
58functions determine the larger of the absolute values of
59.Fa x
60and
61.Fa y ,
62and return the argument with the larger absolute value,
63preferring a numeric value over an \*(Na.
64If one argument is a numeric value and the other is an \*(Na,
65the numeric value is returned.
66If the absolute values are equal, the behavior is equivalent to calling the corresponding
67.Fn fmaximum_num
68function on the arguments.
69.Pp
70Likewise, the
71.Fn fminimum_mag_num ,
72.Fn fminimum_mag_numf ,
73and
74.Fn fminimum_mag_numl
75functions determine the smaller of the absolute values of
76.Fa x
77and
78.Fa y ,
79and return the argument with the smaller absolute value,
80preferring a numeric value over an \*(Na.
81If one argument is a numeric value and the other is an \*(Na,
82the numeric value is returned.
83If the absolute values are equal, the behavior is equivalent to calling the corresponding
84.Fn fminimum_num
85function on the arguments.
86.Pp
87If both arguments are \*(Nas, a quiet \*(Na is returned.
88If either argument is a signaling \*(Na, an invalid exception is raised.
89Otherwise, these routines do not raise any floating-point exceptions.
90.Sh SEE ALSO
91.Xr fmax 3 ,
92.Xr fmaximum 3 ,
93.Xr fmaximum_mag 3 ,
94.Xr fmaximum_num 3 ,
95.Xr math 3
96.Sh STANDARDS
97The
98.Fn fmaximum_mag_num ,
99.Fn fmaximum_mag_numf ,
100.Fn fmaximum_mag_numl ,
101.Fn fminimum_mag_num ,
102.Fn fminimum_mag_numf ,
103and
104.Fn fminimum_mag_numl
105functions conform to
106.St -isoC-2023 .
107.Sh HISTORY
108These routines first appeared in
109.Fx 16.0 ..\"
110