1.\" $NetBSD: imax.9,v 1.2 2006/07/30 00:19:43 wiz Exp $ 2.\" 3.\" Copyright (c) 2006 Igor Sobrado 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Matt THomas. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 3. Neither the name of The NetBSD Foundation nor the names of its 18.\" contributors may be used to endorse or promote products derived 19.\" from this software without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 22.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 23.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 24.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 25.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31.\" POSSIBILITY OF SUCH DAMAGE. 32.\" 33.Dd April 23, 2006 34.Dt IMAX 9 35.Os 36.Sh NAME 37.Nm imax , 38.Nm imin , 39.Nm lmax , 40.Nm lmin , 41.Nm max , 42.Nm min , 43.Nm ulmax , 44.Nm ulmin 45.Nd compare integers 46.Sh SYNOPSIS 47.Ft int 48.Fn imax "int a" "int b" 49.Ft int 50.Fn imin "int a" "int b" 51.Ft long 52.Fn lmax "long a" "long b" 53.Ft long 54.Fn lmin "long a" "long b" 55.Ft u_int 56.Fn max "u_int a" "u_int b" 57.Ft u_int 58.Fn min "u_int a" "u_int b" 59.Ft u_long 60.Fn ulmax "u_long a" "u_long b" 61.Ft u_long 62.Fn ulmin "u_long a" "u_long b" 63.Sh DESCRIPTION 64The 65.Fn imin , 66.Fn lmin , 67.Fn min , 68and 69.Fn ulmin 70functions return whichever argument is algebraically smaller, differing only 71in their argument and return types: these functions operate on, respectively, 72natural size, long, unsigned and unsigned long integers. 73.Pp 74The 75.Fn imax , 76.Fn lmax , 77.Fn max , 78and 79.Fn ulmax 80functions are identical except that they return the algebraically larger 81argument between 82.Ar a 83and 84.Ar b . 85