1*c4b850a8Swiz.\" $NetBSD: lrint.3,v 1.1 2005/09/16 15:26:47 wiz Exp $ 2*c4b850a8Swiz.\" 3*c4b850a8Swiz.\" Copyright (c) 2005 David Schultz <das@FreeBSD.org> 4*c4b850a8Swiz.\" All rights reserved. 5*c4b850a8Swiz.\" 6*c4b850a8Swiz.\" Redistribution and use in source and binary forms, with or without 7*c4b850a8Swiz.\" modification, are permitted provided that the following conditions 8*c4b850a8Swiz.\" are met: 9*c4b850a8Swiz.\" 1. Redistributions of source code must retain the above copyright 10*c4b850a8Swiz.\" notice, this list of conditions and the following disclaimer. 11*c4b850a8Swiz.\" 2. Redistributions in binary form must reproduce the above copyright 12*c4b850a8Swiz.\" notice, this list of conditions and the following disclaimer in the 13*c4b850a8Swiz.\" documentation and/or other materials provided with the distribution. 14*c4b850a8Swiz.\" 15*c4b850a8Swiz.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16*c4b850a8Swiz.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17*c4b850a8Swiz.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18*c4b850a8Swiz.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19*c4b850a8Swiz.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20*c4b850a8Swiz.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21*c4b850a8Swiz.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22*c4b850a8Swiz.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23*c4b850a8Swiz.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24*c4b850a8Swiz.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25*c4b850a8Swiz.\" SUCH DAMAGE. 26*c4b850a8Swiz.\" 27*c4b850a8Swiz.\" $FreeBSD: /repoman/r/ncvs/src/lib/msun/man/lrint.3,v 1.2.2.2 2005/03/01 16:18:39 brueffer Exp $ 28*c4b850a8Swiz.\" 29*c4b850a8Swiz.Dd January 11, 2005 30*c4b850a8Swiz.Dt LRINT 3 31*c4b850a8Swiz.Os 32*c4b850a8Swiz.Sh NAME 33*c4b850a8Swiz.Nm llrint , 34*c4b850a8Swiz.Nm llrintf , 35*c4b850a8Swiz.Nm lrint , 36*c4b850a8Swiz.Nm lrintf 37*c4b850a8Swiz.Nd convert to integer 38*c4b850a8Swiz.Sh LIBRARY 39*c4b850a8Swiz.Lb libm 40*c4b850a8Swiz.Sh SYNOPSIS 41*c4b850a8Swiz.In math.h 42*c4b850a8Swiz.Ft long long 43*c4b850a8Swiz.Fn llrint "double x" 44*c4b850a8Swiz.Ft long long 45*c4b850a8Swiz.Fn llrintf "float x" 46*c4b850a8Swiz.Ft long 47*c4b850a8Swiz.Fn lrint "double x" 48*c4b850a8Swiz.Ft long 49*c4b850a8Swiz.Fn lrintf "float x" 50*c4b850a8Swiz.Sh DESCRIPTION 51*c4b850a8SwizThe 52*c4b850a8Swiz.Fn lrint 53*c4b850a8Swizfunction returns the integer nearest to its argument 54*c4b850a8Swiz.Fa x 55*c4b850a8Swizaccording to the current rounding mode. 56*c4b850a8Swiz.Pp 57*c4b850a8SwizThe 58*c4b850a8Swiz.Fn llrint , 59*c4b850a8Swiz.Fn llrintf , 60*c4b850a8Swizand 61*c4b850a8Swiz.Fn lrintf 62*c4b850a8Swizfunctions differ from 63*c4b850a8Swiz.Fn lrint 64*c4b850a8Swizonly in their input and output types. 65*c4b850a8Swiz.Sh RETURN VALUES 66*c4b850a8SwizThe 67*c4b850a8Swiz.Nm llrint , 68*c4b850a8Swiz.Nm llrintf , 69*c4b850a8Swiz.Nm lrint , 70*c4b850a8Swizand 71*c4b850a8Swiz.Nm lrintf 72*c4b850a8Swizfunctions return the integer nearest to their argument 73*c4b850a8Swiz.Fa x 74*c4b850a8Swizaccording to the current rounding mode. 75*c4b850a8SwizIf the rounded result is too large to be represented as a 76*c4b850a8Swiz.Vt long long 77*c4b850a8Swizor 78*c4b850a8Swiz.Vt long 79*c4b850a8Swizvalue, respectively, 80*c4b850a8Swiz.\" an invalid exception is raised and 81*c4b850a8Swizthe return value is undefined. 82*c4b850a8Swiz.\" Otherwise, if 83*c4b850a8Swiz.\" .Fa x 84*c4b850a8Swiz.\" is not an integer, 85*c4b850a8Swiz.\" .Fn lrint 86*c4b850a8Swiz.\" raises an inexact exception. 87*c4b850a8Swiz.\" If 88*c4b850a8Swiz.\" .Fa x 89*c4b850a8Swiz.\" is too large, a range error may occur. 90*c4b850a8Swiz.Sh SEE ALSO 91*c4b850a8Swiz.\" .Xr lround 3 , 92*c4b850a8Swiz.Xr math 3 , 93*c4b850a8Swiz.Xr rint 3 , 94*c4b850a8Swiz.Xr round 3 95*c4b850a8Swiz.Sh STANDARDS 96*c4b850a8SwizThe 97*c4b850a8Swiz.Fn llrint , 98*c4b850a8Swiz.Fn llrintf , 99*c4b850a8Swiz.Fn lrint , 100*c4b850a8Swizand 101*c4b850a8Swiz.Fn lrintf 102*c4b850a8Swizfunctions conform to 103*c4b850a8Swiz.St -isoC-99 . 104