126573d88Schristos.\" Copyright (c) 2004 David Schultz <das@FreeBSD.org> 226573d88Schristos.\" All rights reserved. 326573d88Schristos.\" 426573d88Schristos.\" Redistribution and use in source and binary forms, with or without 526573d88Schristos.\" modification, are permitted provided that the following conditions 626573d88Schristos.\" are met: 726573d88Schristos.\" 1. Redistributions of source code must retain the above copyright 826573d88Schristos.\" notice, this list of conditions and the following disclaimer. 926573d88Schristos.\" 2. Redistributions in binary form must reproduce the above copyright 1026573d88Schristos.\" notice, this list of conditions and the following disclaimer in the 1126573d88Schristos.\" documentation and/or other materials provided with the distribution. 1226573d88Schristos.\" 1326573d88Schristos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1426573d88Schristos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1526573d88Schristos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1626573d88Schristos.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1726573d88Schristos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1826573d88Schristos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1926573d88Schristos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2026573d88Schristos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2126573d88Schristos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2226573d88Schristos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2326573d88Schristos.\" SUCH DAMAGE. 2426573d88Schristos.\" 2526573d88Schristos.\" $FreeBSD: src/lib/msun/man/fmax.3,v 1.2 2005/01/14 09:12:05 ru Exp $ 26*d4a6f9b0Ssnj.\" $NetBSD: fmax.3,v 1.2 2010/03/08 02:35:50 snj Exp $ 2726573d88Schristos.\" 2826573d88Schristos.Dd June 29, 2004 2926573d88Schristos.Dt FMAX 3 3026573d88Schristos.Os 3126573d88Schristos.Sh NAME 3226573d88Schristos.Nm fmax , 3326573d88Schristos.Nm fmaxf , 3426573d88Schristos.Nm fmaxl , 3526573d88Schristos.Nm fmin , 3626573d88Schristos.Nm fminf , 3726573d88Schristos.Nm fminl 3826573d88Schristos.Nd floating-point maximum and minimum functions 3926573d88Schristos.Sh LIBRARY 4026573d88Schristos.Lb libm 4126573d88Schristos.Sh SYNOPSIS 4226573d88Schristos.In math.h 4326573d88Schristos.Ft double 4426573d88Schristos.Fn fmax "double x" "double y" 4526573d88Schristos.Ft float 4626573d88Schristos.Fn fmaxf "float x" "float y" 4726573d88Schristos.Ft "long double" 4826573d88Schristos.Fn fmaxl "long double x" "long double y" 4926573d88Schristos.Ft double 5026573d88Schristos.Fn fmin "double x" "double y" 5126573d88Schristos.Ft float 5226573d88Schristos.Fn fminf "float x" "float y" 5326573d88Schristos.Ft "long double" 5426573d88Schristos.Fn fminl "long double x" "long double y" 5526573d88Schristos.Sh DESCRIPTION 5626573d88SchristosThe 5726573d88Schristos.Fn fmax , 5826573d88Schristos.Fn fmaxf , 5926573d88Schristosand 6026573d88Schristos.Fn fmaxl 6126573d88Schristosfunctions return the larger of 6226573d88Schristos.Fa x 6326573d88Schristosand 6426573d88Schristos.Fa y , 6526573d88Schristosand likewise, the 6626573d88Schristos.Fn fmin , 6726573d88Schristos.Fn fminf , 6826573d88Schristosand 6926573d88Schristos.Fn fminl 7026573d88Schristosfunctions return the smaller of 7126573d88Schristos.Fa x 7226573d88Schristosand 7326573d88Schristos.Fa y . 7426573d88SchristosThey treat 7526573d88Schristos.Li +0.0 7626573d88Schristosas being larger than 7726573d88Schristos.Li -0.0 . 7826573d88SchristosIf one argument is an \*(Na, then the other argument is returned. 7926573d88SchristosIf both arguments are \*(Nas, then the result is an \*(Na. 8026573d88SchristosThese routines do not raise any floating-point exceptions. 8126573d88Schristos.Sh SEE ALSO 8226573d88Schristos.Xr fabs 3 , 8326573d88Schristos.Xr fdim 3 , 8426573d88Schristos.Xr math 3 8526573d88Schristos.Sh STANDARDS 8626573d88SchristosThe 8726573d88Schristos.Fn fmax , 8826573d88Schristos.Fn fmaxf , 8926573d88Schristos.Fn fmaxl , 9026573d88Schristos.Fn fmin , 9126573d88Schristos.Fn fminf , 9226573d88Schristosand 9326573d88Schristos.Fn fminl 9426573d88Schristosfunctions conform to 9526573d88Schristos.St -isoC-99 . 9626573d88Schristos.Sh HISTORY 9726573d88SchristosThese routines first appeared in 9826573d88Schristos.Fx 5.3 9926573d88Schristosand 100*d4a6f9b0Ssnj.Nx 5.1 . 101