161f28255Scgd.\" Copyright (c) 1985, 1991 Regents of the University of California. 261f28255Scgd.\" All rights reserved. 361f28255Scgd.\" 461f28255Scgd.\" Redistribution and use in source and binary forms, with or without 561f28255Scgd.\" modification, are permitted provided that the following conditions 661f28255Scgd.\" are met: 761f28255Scgd.\" 1. Redistributions of source code must retain the above copyright 861f28255Scgd.\" notice, this list of conditions and the following disclaimer. 961f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright 1061f28255Scgd.\" notice, this list of conditions and the following disclaimer in the 1161f28255Scgd.\" documentation and/or other materials provided with the distribution. 12eb7c1594Sagc.\" 3. Neither the name of the University nor the names of its contributors 1361f28255Scgd.\" may be used to endorse or promote products derived from this software 1461f28255Scgd.\" without specific prior written permission. 1561f28255Scgd.\" 1661f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1761f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1861f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1961f28255Scgd.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2061f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2161f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2261f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2361f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2461f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2561f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2661f28255Scgd.\" SUCH DAMAGE. 2761f28255Scgd.\" 28dfb9caabSmycroft.\" from: @(#)rint.3 5.1 (Berkeley) 5/2/91 29*46a77463Swiz.\" $NetBSD: rint.3,v 1.15 2015/09/13 10:46:41 wiz Exp $ 3061f28255Scgd.\" 31a9e1b078She.Dd September 13, 2015 3261f28255Scgd.Dt RINT 3 3361f28255Scgd.Os 3461f28255Scgd.Sh NAME 35a9e1b078She.Nm nearbyint , 36a9e1b078She.Nm nearbyintf , 37a9e1b078She.Nm nearbyintl , 38f8173630Skleink.Nm rint , 39a9e1b078She.Nm rintf , 40a9e1b078She.Nm rintl 41d264f557Sjtc.Nd round to integral value in floating-point format 42312aca53Sperry.Sh LIBRARY 43312aca53Sperry.Lb libm 4461f28255Scgd.Sh SYNOPSIS 45472351e1Swiz.In math.h 4661f28255Scgd.Ft double 47a9e1b078She.Fn nearbyint "double x" 48a9e1b078She.Ft float 49a9e1b078She.Fn nearbyintf "float x" 50a9e1b078She.Ft long double 51a9e1b078She.Fn nearbyintl "long double x" 52a9e1b078She.Ft double 5361f28255Scgd.Fn rint "double x" 54df8b005fSjtc.Ft float 55df8b005fSjtc.Fn rintf "float x" 56a9e1b078She.Ft long double 57a9e1b078She.Fn rintl "long double x" 5861f28255Scgd.Sh DESCRIPTION 5961f28255ScgdThe 60a9e1b078She.Fn rint , 61a9e1b078She.Fn rintf , 62a9e1b078Sheand 63a9e1b078She.Fn rintl 64*46a77463Swizfunctions return the integral value nearest to 6561f28255Scgd.Fa x 66d264f557Sjtcaccording to the prevailing rounding mode. 67a9e1b078SheThese functions raise an inexact exception when the original argument 68a9e1b078Sheis not an exact integer. 69a9e1b078She.Pp 70a9e1b078SheThe 71a9e1b078She.Fn nearbyint , 72a9e1b078She.Fn nearbyintf , 73a9e1b078Sheand 74a9e1b078She.Fn nearbyintl 75a9e1b078Shefunctions perform the same operation, except that they do not raise 76a9e1b078Shean inexact exception. 7761f28255Scgd.Sh SEE ALSO 7861f28255Scgd.Xr abs 3 , 7961f28255Scgd.Xr ceil 3 , 80306d24c5Swiz.Xr fabs 3 , 81a9e1b078She.Xr fenv 3 , 8261f28255Scgd.Xr floor 3 , 83a9e1b078She.Xr lrint 3 , 84a9e1b078She.Xr math 3 , 85a9e1b078She.Xr round 3 8661f28255Scgd.Sh HISTORY 8761f28255ScgdA 8861f28255Scgd.Fn rint 8961f28255Scgdfunction appeared in 9061f28255Scgd.At v6 . 91