xref: /openbsd-src/lib/libm/man/round.3 (revision 0714f1f8ae9df2568b8c9b3030c1bf24ba7e2c0c)
1*0714f1f8Smartynas.\"	$OpenBSD: round.3,v 1.5 2011/07/07 01:34:52 martynas Exp $
265850ae2Sbrad.\" Copyright (c) 2003, Steven G. Kargl
365850ae2Sbrad.\" All rights reserved.
465850ae2Sbrad.\"
565850ae2Sbrad.\" Redistribution and use in source and binary forms, with or without
665850ae2Sbrad.\" modification, are permitted provided that the following conditions
765850ae2Sbrad.\" are met:
865850ae2Sbrad.\" 1. Redistributions of source code must retain the above copyright
965850ae2Sbrad.\"    notice, this list of conditions and the following disclaimer.
1065850ae2Sbrad.\" 2. Redistributions in binary form must reproduce the above copyright
1165850ae2Sbrad.\"    notice, this list of conditions and the following disclaimer in the
1265850ae2Sbrad.\"    documentation and/or other materials provided with the distribution.
1365850ae2Sbrad.\"
1465850ae2Sbrad.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1565850ae2Sbrad.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1665850ae2Sbrad.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1765850ae2Sbrad.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
1865850ae2Sbrad.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1965850ae2Sbrad.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2065850ae2Sbrad.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2165850ae2Sbrad.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2265850ae2Sbrad.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2365850ae2Sbrad.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2465850ae2Sbrad.\" SUCH DAMAGE.
2565850ae2Sbrad.\"
2665850ae2Sbrad.\" $FreeBSD: src/lib/msun/man/round.3,v 1.6 2005/06/15 19:04:04 ru Exp $
2765850ae2Sbrad.\"
287ac6a943Smartynas.Dd $Mdocdate: July 7 2011 $
2965850ae2Sbrad.Dt ROUND 3
3065850ae2Sbrad.Os
3165850ae2Sbrad.Sh NAME
3265850ae2Sbrad.Nm round ,
337ac6a943Smartynas.Nm roundf ,
347ac6a943Smartynas.Nm roundl
3565850ae2Sbrad.Nd round to nearest integral value
3665850ae2Sbrad.Sh SYNOPSIS
3765850ae2Sbrad.In math.h
3865850ae2Sbrad.Ft double
3965850ae2Sbrad.Fn round "double x"
4065850ae2Sbrad.Ft float
4165850ae2Sbrad.Fn roundf "float x"
427ac6a943Smartynas.Ft long double
437ac6a943Smartynas.Fn roundl "long double x"
4465850ae2Sbrad.Sh DESCRIPTION
4565850ae2SbradThe
467ac6a943Smartynas.Fn round ,
4765850ae2Sbrad.Fn roundf
487ac6a943Smartynasand
497ac6a943Smartynas.Fn roundl
5065850ae2Sbradfunctions return the nearest integral value to
5165850ae2Sbrad.Fa x ;
5265850ae2Sbradif
5365850ae2Sbrad.Fa x
5465850ae2Sbradlies halfway between two integral values, then these
5565850ae2Sbradfunctions return the integral value with the larger
5665850ae2Sbradabsolute value (i.e., they round away from zero).
5765850ae2Sbrad.Sh SEE ALSO
5865850ae2Sbrad.Xr ceil 3 ,
5965850ae2Sbrad.Xr floor 3 ,
6065850ae2Sbrad.Xr lrint 3 ,
6165850ae2Sbrad.Xr lround 3 ,
62287d7838Smartynas.Xr nextafter 3 ,
6365850ae2Sbrad.Xr rint 3 ,
6465850ae2Sbrad.Xr trunc 3
6565850ae2Sbrad.Sh STANDARDS
6665850ae2SbradThese functions conform to
6765850ae2Sbrad.St -isoC-99 .
68