1*0f7b5e2fSjmc.\" $OpenBSD: imax.9,v 1.2 2018/04/23 11:11:38 jmc Exp $ 2175775bbSdlg.\" 3175775bbSdlg.\" Copyright (c) 2002, 2003 CubeSoft Communications, Inc. 4175775bbSdlg.\" <http://www.csoft.org> 5175775bbSdlg.\" 6175775bbSdlg.\" Redistribution and use in source and binary forms, with or without 7175775bbSdlg.\" modification, are permitted provided that the following conditions 8175775bbSdlg.\" are met: 9175775bbSdlg.\" 1. Redistributions of source code must retain the above copyright 10175775bbSdlg.\" notice, this list of conditions and the following disclaimer. 11175775bbSdlg.\" 2. Redistributions in binary form must reproduce the above copyright 12175775bbSdlg.\" notice, this list of conditions and the following disclaimer in the 13175775bbSdlg.\" documentation and/or other materials provided with the distribution. 14175775bbSdlg.\" 15175775bbSdlg.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16175775bbSdlg.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17175775bbSdlg.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18175775bbSdlg.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 19175775bbSdlg.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20175775bbSdlg.\" (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21175775bbSdlg.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22175775bbSdlg.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 23175775bbSdlg.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24175775bbSdlg.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE 25175775bbSdlg.\" POSSIBILITY OF SUCH DAMAGE. 26175775bbSdlg.\" 27175775bbSdlg.Dd $Mdocdate: April 23 2018 $ 28175775bbSdlg.Dt IMAX 9 29175775bbSdlg.Os 30175775bbSdlg.Sh NAME 31175775bbSdlg.Nm imax , 32175775bbSdlg.Nm imin , 33175775bbSdlg.Nm lmax , 34175775bbSdlg.Nm lmin , 35175775bbSdlg.Nm max , 36175775bbSdlg.Nm min , 37175775bbSdlg.Nm ulmax , 38175775bbSdlg.Nm ulmin , 39175775bbSdlg.Nm abs 40175775bbSdlg.Nd kernel library math routines 41175775bbSdlg.Sh SYNOPSIS 42175775bbSdlg.In lib/libkern/libkern.h 43175775bbSdlg.Ft int 44175775bbSdlg.Fn imax "int a" "int b" 45175775bbSdlg.Ft int 46175775bbSdlg.Fn imin "int a" "int b" 47175775bbSdlg.Ft long 48175775bbSdlg.Fn lmax "long a" "long b" 49175775bbSdlg.Ft long 50175775bbSdlg.Fn lmin "long a" "long b" 51175775bbSdlg.Ft u_int 52175775bbSdlg.Fn max "u_int a" "u_int b" 53175775bbSdlg.Ft u_int 54175775bbSdlg.Fn min "u_int a" "u_int b" 55175775bbSdlg.Ft u_long 56175775bbSdlg.Fn ulmax "u_long a" "u_long b" 57175775bbSdlg.Ft u_long 58175775bbSdlg.Fn ulmin "u_long a" "u_long b" 59175775bbSdlg.Ft int 60175775bbSdlg.Fn abs "int j" 61175775bbSdlg.Sh DESCRIPTION 62175775bbSdlgThe 63175775bbSdlg.Fn min , 64175775bbSdlg.Fn imin , 65175775bbSdlg.Fn lmin 66175775bbSdlgand 67175775bbSdlg.Fn ulmin 68175775bbSdlgfunctions return the smallest integer between 69175775bbSdlg.Fa a 70175775bbSdlgand 71175775bbSdlg.Fa b , 72175775bbSdlginclusive. 73175775bbSdlgThe 74175775bbSdlg.Fn max , 75175775bbSdlg.Fn imax , 76175775bbSdlg.Fn lmax 77175775bbSdlgand 78175775bbSdlg.Fn ulmax 79175775bbSdlgfunctions return the largest integer between 80175775bbSdlg.Fa a 81175775bbSdlgand 82175775bbSdlg.Fa b , 83175775bbSdlginclusive. 84175775bbSdlg.Pp 85175775bbSdlgThe 86175775bbSdlg.Fn abs 87175775bbSdlgfunction computes the absolute value of integer 88175775bbSdlg.Fa j . 89175775bbSdlg.Sh STANDARDS 90175775bbSdlgThe 91175775bbSdlg.Fn abs 92*0f7b5e2fSjmcfunction conforms to 93175775bbSdlg.St -ansiC . 94