12fe8fb19SBen Gras.\" Copyright (c) 1985, 1991 Regents of the University of California. 22fe8fb19SBen Gras.\" All rights reserved. 32fe8fb19SBen Gras.\" 42fe8fb19SBen Gras.\" Redistribution and use in source and binary forms, with or without 52fe8fb19SBen Gras.\" modification, are permitted provided that the following conditions 62fe8fb19SBen Gras.\" are met: 72fe8fb19SBen Gras.\" 1. Redistributions of source code must retain the above copyright 82fe8fb19SBen Gras.\" notice, this list of conditions and the following disclaimer. 92fe8fb19SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 102fe8fb19SBen Gras.\" notice, this list of conditions and the following disclaimer in the 112fe8fb19SBen Gras.\" documentation and/or other materials provided with the distribution. 122fe8fb19SBen Gras.\" 3. Neither the name of the University nor the names of its contributors 132fe8fb19SBen Gras.\" may be used to endorse or promote products derived from this software 142fe8fb19SBen Gras.\" without specific prior written permission. 152fe8fb19SBen Gras.\" 162fe8fb19SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 172fe8fb19SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 182fe8fb19SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 192fe8fb19SBen Gras.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 202fe8fb19SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 212fe8fb19SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 222fe8fb19SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 232fe8fb19SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 242fe8fb19SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 252fe8fb19SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 262fe8fb19SBen Gras.\" SUCH DAMAGE. 272fe8fb19SBen Gras.\" 282fe8fb19SBen Gras.\" from: @(#)rint.3 5.1 (Berkeley) 5/2/91 29*0a6a1f1dSLionel Sambuc.\" $NetBSD: rint.3,v 1.15 2015/09/13 10:46:41 wiz Exp $ 302fe8fb19SBen Gras.\" 31*0a6a1f1dSLionel Sambuc.Dd September 13, 2015 322fe8fb19SBen Gras.Dt RINT 3 332fe8fb19SBen Gras.Os 342fe8fb19SBen Gras.Sh NAME 35*0a6a1f1dSLionel Sambuc.Nm nearbyint , 36*0a6a1f1dSLionel Sambuc.Nm nearbyintf , 37*0a6a1f1dSLionel Sambuc.Nm nearbyintl , 382fe8fb19SBen Gras.Nm rint , 39*0a6a1f1dSLionel Sambuc.Nm rintf , 40*0a6a1f1dSLionel Sambuc.Nm rintl 412fe8fb19SBen Gras.Nd round to integral value in floating-point format 422fe8fb19SBen Gras.Sh LIBRARY 432fe8fb19SBen Gras.Lb libm 442fe8fb19SBen Gras.Sh SYNOPSIS 452fe8fb19SBen Gras.In math.h 462fe8fb19SBen Gras.Ft double 47*0a6a1f1dSLionel Sambuc.Fn nearbyint "double x" 48*0a6a1f1dSLionel Sambuc.Ft float 49*0a6a1f1dSLionel Sambuc.Fn nearbyintf "float x" 50*0a6a1f1dSLionel Sambuc.Ft long double 51*0a6a1f1dSLionel Sambuc.Fn nearbyintl "long double x" 52*0a6a1f1dSLionel Sambuc.Ft double 532fe8fb19SBen Gras.Fn rint "double x" 542fe8fb19SBen Gras.Ft float 552fe8fb19SBen Gras.Fn rintf "float x" 56*0a6a1f1dSLionel Sambuc.Ft long double 57*0a6a1f1dSLionel Sambuc.Fn rintl "long double x" 582fe8fb19SBen Gras.Sh DESCRIPTION 592fe8fb19SBen GrasThe 60*0a6a1f1dSLionel Sambuc.Fn rint , 61*0a6a1f1dSLionel Sambuc.Fn rintf , 62*0a6a1f1dSLionel Sambucand 63*0a6a1f1dSLionel Sambuc.Fn rintl 64*0a6a1f1dSLionel Sambucfunctions return the integral value nearest to 652fe8fb19SBen Gras.Fa x 662fe8fb19SBen Grasaccording to the prevailing rounding mode. 67*0a6a1f1dSLionel SambucThese functions raise an inexact exception when the original argument 68*0a6a1f1dSLionel Sambucis not an exact integer. 69*0a6a1f1dSLionel Sambuc.Pp 70*0a6a1f1dSLionel SambucThe 71*0a6a1f1dSLionel Sambuc.Fn nearbyint , 72*0a6a1f1dSLionel Sambuc.Fn nearbyintf , 73*0a6a1f1dSLionel Sambucand 74*0a6a1f1dSLionel Sambuc.Fn nearbyintl 75*0a6a1f1dSLionel Sambucfunctions perform the same operation, except that they do not raise 76*0a6a1f1dSLionel Sambucan inexact exception. 772fe8fb19SBen Gras.Sh SEE ALSO 782fe8fb19SBen Gras.Xr abs 3 , 792fe8fb19SBen Gras.Xr ceil 3 , 802fe8fb19SBen Gras.Xr fabs 3 , 81*0a6a1f1dSLionel Sambuc.Xr fenv 3 , 822fe8fb19SBen Gras.Xr floor 3 , 83*0a6a1f1dSLionel Sambuc.Xr lrint 3 , 84*0a6a1f1dSLionel Sambuc.Xr math 3 , 85*0a6a1f1dSLionel Sambuc.Xr round 3 862fe8fb19SBen Gras.Sh HISTORY 872fe8fb19SBen GrasA 882fe8fb19SBen Gras.Fn rint 892fe8fb19SBen Grasfunction appeared in 902fe8fb19SBen Gras.At v6 . 91