The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | .\" Copyright (c) 1985, 1991 Regents of the University of California. |
| 2 | .\" All rights reserved. |
| 3 | .\" |
| 4 | .\" Redistribution and use in source and binary forms, with or without |
| 5 | .\" modification, are permitted provided that the following conditions |
| 6 | .\" are met: |
| 7 | .\" 1. Redistributions of source code must retain the above copyright |
| 8 | .\" notice, this list of conditions and the following disclaimer. |
| 9 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| 10 | .\" notice, this list of conditions and the following disclaimer in the |
| 11 | .\" documentation and/or other materials provided with the distribution. |
| 12 | .\" 3. All advertising materials mentioning features or use of this software |
| 13 | .\" must display the following acknowledgement: |
| 14 | .\" This product includes software developed by the University of |
| 15 | .\" California, Berkeley and its contributors. |
| 16 | .\" 4. Neither the name of the University nor the names of its contributors |
| 17 | .\" may be used to endorse or promote products derived from this software |
| 18 | .\" without specific prior written permission. |
| 19 | .\" |
| 20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
| 21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
| 24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 30 | .\" SUCH DAMAGE. |
| 31 | .\" |
| 32 | .\" from: @(#)rint.3 5.1 (Berkeley) 5/2/91 |
| 33 | .\" $FreeBSD: src/lib/msun/man/rint.3,v 1.11 2005/01/11 23:12:17 das Exp $ |
| 34 | .\" |
| 35 | .Dd July 5, 2004 |
| 36 | .Dt RINT 3 |
| 37 | .Os |
| 38 | .Sh NAME |
| 39 | .Nm nearbyint , |
| 40 | .Nm nearbyintf , |
| 41 | .Nm rint , |
| 42 | .Nm rintf |
| 43 | .Nd round to integral value in floating-point format |
| 44 | .Sh LIBRARY |
| 45 | .Lb libm |
| 46 | .Sh SYNOPSIS |
| 47 | .In math.h |
| 48 | .Ft double |
| 49 | .Fn nearbyint "double x" |
| 50 | .Ft float |
| 51 | .Fn nearbyintf "float x" |
| 52 | .Ft double |
| 53 | .Fn rint "double x" |
| 54 | .Ft float |
| 55 | .Fn rintf "float x" |
| 56 | .Sh DESCRIPTION |
| 57 | The |
| 58 | .Fn rint |
| 59 | and the |
| 60 | .Fn rintf |
| 61 | functions return the integral value nearest to |
| 62 | .Fa x |
| 63 | according to the prevailing rounding mode. |
| 64 | These functions raise an inexact exception when the original argument |
| 65 | is not an exact integer. |
| 66 | .Pp |
| 67 | The |
| 68 | .Fn nearbyint |
| 69 | and |
| 70 | .Fn nearbyintf |
| 71 | functions perform the same operation, except that they do not raise |
| 72 | an inexact exception. |
| 73 | .Sh SEE ALSO |
| 74 | .Xr abs 3 , |
| 75 | .Xr ceil 3 , |
| 76 | .Xr fabs 3 , |
| 77 | .Xr fenv 3 , |
| 78 | .Xr floor 3 , |
| 79 | .Xr ieee 3 , |
| 80 | .Xr lrint 3 , |
| 81 | .Xr lround 3 , |
| 82 | .Xr math 3 , |
| 83 | .Xr round 3 |
| 84 | .Sh STANDARDS |
| 85 | The |
| 86 | .Fn nearbyint , |
| 87 | .Fn nearbyintf , |
| 88 | .Fn rint , |
| 89 | and |
| 90 | .Fn rintf |
| 91 | functions conform to |
| 92 | .St -isoC-99 . |
| 93 | .Sh HISTORY |
| 94 | A |
| 95 | .Fn rint |
| 96 | function appeared in |
| 97 | .At v6 . |
| 98 | The |
| 99 | .Fn nearbyint |
| 100 | and |
| 101 | .Fn nearbyintf |
| 102 | functions appeared in |
| 103 | .Fx 5.3 . |