1*05a0b428SJohn Marino.\" $OpenBSD: fmax.3,v 1.2 2011/07/07 01:34:52 martynas Exp $ 2*05a0b428SJohn Marino.\" 3*05a0b428SJohn Marino.\" Copyright (c) 2004 David Schultz <das@FreeBSD.org> 4*05a0b428SJohn Marino.\" All rights reserved. 5*05a0b428SJohn Marino.\" 6*05a0b428SJohn Marino.\" Redistribution and use in source and binary forms, with or without 7*05a0b428SJohn Marino.\" modification, are permitted provided that the following conditions 8*05a0b428SJohn Marino.\" are met: 9*05a0b428SJohn Marino.\" 1. Redistributions of source code must retain the above copyright 10*05a0b428SJohn Marino.\" notice, this list of conditions and the following disclaimer. 11*05a0b428SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright 12*05a0b428SJohn Marino.\" notice, this list of conditions and the following disclaimer in the 13*05a0b428SJohn Marino.\" documentation and/or other materials provided with the distribution. 14*05a0b428SJohn Marino.\" 15*05a0b428SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16*05a0b428SJohn Marino.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17*05a0b428SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18*05a0b428SJohn Marino.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19*05a0b428SJohn Marino.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20*05a0b428SJohn Marino.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21*05a0b428SJohn Marino.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22*05a0b428SJohn Marino.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23*05a0b428SJohn Marino.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24*05a0b428SJohn Marino.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25*05a0b428SJohn Marino.\" SUCH DAMAGE. 26*05a0b428SJohn Marino.\" 27*05a0b428SJohn Marino.\" $FreeBSD: src/lib/msun/man/fmax.3,v 1.2 2005/01/14 09:12:05 ru Exp $ 28*05a0b428SJohn Marino.\" 29*05a0b428SJohn Marino.Dd $Mdocdate: July 7 2011 $ 30*05a0b428SJohn Marino.Dt FMAX 3 31*05a0b428SJohn Marino.Os 32*05a0b428SJohn Marino.Sh NAME 33*05a0b428SJohn Marino.Nm fmax , 34*05a0b428SJohn Marino.Nm fmaxf , 35*05a0b428SJohn Marino.Nm fmaxl , 36*05a0b428SJohn Marino.Nm fmin , 37*05a0b428SJohn Marino.Nm fminf , 38*05a0b428SJohn Marino.Nm fminl 39*05a0b428SJohn Marino.Nd floating-point maximum and minimum functions 40*05a0b428SJohn Marino.Sh SYNOPSIS 41*05a0b428SJohn Marino.In math.h 42*05a0b428SJohn Marino.Ft double 43*05a0b428SJohn Marino.Fn fmax "double x" "double y" 44*05a0b428SJohn Marino.Ft float 45*05a0b428SJohn Marino.Fn fmaxf "float x" "float y" 46*05a0b428SJohn Marino.Ft "long double" 47*05a0b428SJohn Marino.Fn fmaxl "long double x" "long double y" 48*05a0b428SJohn Marino.Ft double 49*05a0b428SJohn Marino.Fn fmin "double x" "double y" 50*05a0b428SJohn Marino.Ft float 51*05a0b428SJohn Marino.Fn fminf "float x" "float y" 52*05a0b428SJohn Marino.Ft "long double" 53*05a0b428SJohn Marino.Fn fminl "long double x" "long double y" 54*05a0b428SJohn Marino.Sh DESCRIPTION 55*05a0b428SJohn MarinoThe 56*05a0b428SJohn Marino.Fn fmax , 57*05a0b428SJohn Marino.Fn fmaxf , 58*05a0b428SJohn Marinoand 59*05a0b428SJohn Marino.Fn fmaxl 60*05a0b428SJohn Marinofunctions return the larger of 61*05a0b428SJohn Marino.Fa x 62*05a0b428SJohn Marinoand 63*05a0b428SJohn Marino.Fa y , 64*05a0b428SJohn Marinoand likewise the 65*05a0b428SJohn Marino.Fn fmin , 66*05a0b428SJohn Marino.Fn fminf , 67*05a0b428SJohn Marinoand 68*05a0b428SJohn Marino.Fn fminl 69*05a0b428SJohn Marinofunctions return the smaller of 70*05a0b428SJohn Marino.Fa x 71*05a0b428SJohn Marinoand 72*05a0b428SJohn Marino.Fa y . 73*05a0b428SJohn MarinoThey treat 74*05a0b428SJohn Marino.Li +0.0 75*05a0b428SJohn Marinoas being larger than 76*05a0b428SJohn Marino.Li -0.0 . 77*05a0b428SJohn MarinoIf one argument is an \*(Na, then the other argument is returned. 78*05a0b428SJohn MarinoIf both arguments are \*(Nas, then the result is an \*(Na. 79*05a0b428SJohn MarinoThese routines do not raise any floating-point exceptions. 80*05a0b428SJohn Marino.Sh SEE ALSO 81*05a0b428SJohn Marino.Xr fabs 3 , 82*05a0b428SJohn Marino.Xr fdim 3 83*05a0b428SJohn Marino.Sh STANDARDS 84*05a0b428SJohn MarinoThe 85*05a0b428SJohn Marino.Fn fmax , 86*05a0b428SJohn Marino.Fn fmaxf , 87*05a0b428SJohn Marino.Fn fmaxl , 88*05a0b428SJohn Marino.Fn fmin , 89*05a0b428SJohn Marino.Fn fminf , 90*05a0b428SJohn Marinoand 91*05a0b428SJohn Marino.Fn fminl 92*05a0b428SJohn Marinofunctions conform to 93*05a0b428SJohn Marino.St -isoC-99 . 94*05a0b428SJohn Marino.Sh HISTORY 95*05a0b428SJohn MarinoThese routines first appeared in 96*05a0b428SJohn Marino.Ox 4.5 . 97