xref: /freebsd-src/lib/msun/man/fmax.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
14f82cb46SDavid Schultz.\" Copyright (c) 2004 David Schultz <das@FreeBSD.org>
24f82cb46SDavid Schultz.\" All rights reserved.
34f82cb46SDavid Schultz.\"
44f82cb46SDavid Schultz.\" Redistribution and use in source and binary forms, with or without
54f82cb46SDavid Schultz.\" modification, are permitted provided that the following conditions
64f82cb46SDavid Schultz.\" are met:
74f82cb46SDavid Schultz.\" 1. Redistributions of source code must retain the above copyright
84f82cb46SDavid Schultz.\"    notice, this list of conditions and the following disclaimer.
94f82cb46SDavid Schultz.\" 2. Redistributions in binary form must reproduce the above copyright
104f82cb46SDavid Schultz.\"    notice, this list of conditions and the following disclaimer in the
114f82cb46SDavid Schultz.\"    documentation and/or other materials provided with the distribution.
124f82cb46SDavid Schultz.\"
134f82cb46SDavid Schultz.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
144f82cb46SDavid Schultz.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
154f82cb46SDavid Schultz.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
164f82cb46SDavid Schultz.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
174f82cb46SDavid Schultz.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
184f82cb46SDavid Schultz.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
194f82cb46SDavid Schultz.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
204f82cb46SDavid Schultz.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
214f82cb46SDavid Schultz.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
224f82cb46SDavid Schultz.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
234f82cb46SDavid Schultz.\" SUCH DAMAGE.
244f82cb46SDavid Schultz.\"
254f82cb46SDavid Schultz.Dd June 29, 2004
264f82cb46SDavid Schultz.Dt FMAX 3
274f82cb46SDavid Schultz.Os
284f82cb46SDavid Schultz.Sh NAME
294f82cb46SDavid Schultz.Nm fmax ,
304f82cb46SDavid Schultz.Nm fmaxf ,
314f82cb46SDavid Schultz.Nm fmaxl ,
324f82cb46SDavid Schultz.Nm fmin ,
334f82cb46SDavid Schultz.Nm fminf ,
344f82cb46SDavid Schultz.Nm fminl
354f82cb46SDavid Schultz.Nd floating-point maximum and minimum functions
364f82cb46SDavid Schultz.Sh LIBRARY
374f82cb46SDavid Schultz.Lb libm
384f82cb46SDavid Schultz.Sh SYNOPSIS
394f82cb46SDavid Schultz.In math.h
404f82cb46SDavid Schultz.Ft double
414f82cb46SDavid Schultz.Fn fmax "double x" "double y"
424f82cb46SDavid Schultz.Ft float
434f82cb46SDavid Schultz.Fn fmaxf "float x" "float y"
44*e880667bSRuslan Ermilov.Ft "long double"
454f82cb46SDavid Schultz.Fn fmaxl "long double x" "long double y"
464f82cb46SDavid Schultz.Ft double
474f82cb46SDavid Schultz.Fn fmin "double x" "double y"
484f82cb46SDavid Schultz.Ft float
494f82cb46SDavid Schultz.Fn fminf "float x" "float y"
50*e880667bSRuslan Ermilov.Ft "long double"
514f82cb46SDavid Schultz.Fn fminl "long double x" "long double y"
524f82cb46SDavid Schultz.Sh DESCRIPTION
534f82cb46SDavid SchultzThe
544f82cb46SDavid Schultz.Fn fmax ,
554f82cb46SDavid Schultz.Fn fmaxf ,
564f82cb46SDavid Schultzand
574f82cb46SDavid Schultz.Fn fmaxl
584f82cb46SDavid Schultzfunctions return the larger of
594f82cb46SDavid Schultz.Fa x
604f82cb46SDavid Schultzand
614f82cb46SDavid Schultz.Fa y ,
624f82cb46SDavid Schultzand likewise, the
634f82cb46SDavid Schultz.Fn fmin ,
644f82cb46SDavid Schultz.Fn fminf ,
654f82cb46SDavid Schultzand
664f82cb46SDavid Schultz.Fn fminl
674f82cb46SDavid Schultzfunctions return the smaller of
684f82cb46SDavid Schultz.Fa x
694f82cb46SDavid Schultzand
704f82cb46SDavid Schultz.Fa y .
71*e880667bSRuslan ErmilovThey treat
724f82cb46SDavid Schultz.Li +0.0
73*e880667bSRuslan Ermilovas being larger than
744f82cb46SDavid Schultz.Li -0.0 .
754f82cb46SDavid SchultzIf one argument is an \*(Na, then the other argument is returned.
764f82cb46SDavid SchultzIf both arguments are \*(Nas, then the result is an \*(Na.
774f82cb46SDavid SchultzThese routines do not raise any floating-point exceptions.
784f82cb46SDavid Schultz.Sh SEE ALSO
794f82cb46SDavid Schultz.Xr fabs 3 ,
804f82cb46SDavid Schultz.Xr fdim 3 ,
814f82cb46SDavid Schultz.Xr math 3
824f82cb46SDavid Schultz.Sh STANDARDS
834f82cb46SDavid SchultzThe
844f82cb46SDavid Schultz.Fn fmax ,
854f82cb46SDavid Schultz.Fn fmaxf ,
864f82cb46SDavid Schultz.Fn fmaxl ,
874f82cb46SDavid Schultz.Fn fmin ,
884f82cb46SDavid Schultz.Fn fminf ,
894f82cb46SDavid Schultzand
904f82cb46SDavid Schultz.Fn fminl
914f82cb46SDavid Schultzfunctions conform to
924f82cb46SDavid Schultz.St -isoC-99 .
934f82cb46SDavid Schultz.Sh HISTORY
944f82cb46SDavid SchultzThese routines first appeared in
954f82cb46SDavid Schultz.Fx 5.3 .
96