xref: /freebsd/lib/msun/man/round.3 (revision a9a0bf07f3f18041b1f827b098a6106ac6705abb)
1d0f13633SDavid Schultz.\" Copyright (c) 2003, Steven G. Kargl
2d0f13633SDavid Schultz.\" All rights reserved.
3d0f13633SDavid Schultz.\"
4d0f13633SDavid Schultz.\" Redistribution and use in source and binary forms, with or without
5d0f13633SDavid Schultz.\" modification, are permitted provided that the following conditions
6d0f13633SDavid Schultz.\" are met:
7d0f13633SDavid Schultz.\" 1. Redistributions of source code must retain the above copyright
8d0f13633SDavid Schultz.\"    notice, this list of conditions and the following disclaimer.
9d0f13633SDavid Schultz.\" 2. Redistributions in binary form must reproduce the above copyright
10d0f13633SDavid Schultz.\"    notice, this list of conditions and the following disclaimer in the
11d0f13633SDavid Schultz.\"    documentation and/or other materials provided with the distribution.
12d0f13633SDavid Schultz.\"
13d0f13633SDavid Schultz.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
14d0f13633SDavid Schultz.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15d0f13633SDavid Schultz.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16d0f13633SDavid Schultz.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
17d0f13633SDavid Schultz.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18d0f13633SDavid Schultz.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19d0f13633SDavid Schultz.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20d0f13633SDavid Schultz.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21d0f13633SDavid Schultz.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22d0f13633SDavid Schultz.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23d0f13633SDavid Schultz.\" SUCH DAMAGE.
24d0f13633SDavid Schultz.\"
25d0f13633SDavid Schultz.\" $FreeBSD$
26d0f13633SDavid Schultz.\"
27d0f13633SDavid Schultz.Dd November 29, 2003
28d0f13633SDavid Schultz.Dt ROUND 3
29d0f13633SDavid Schultz.Os
30d0f13633SDavid Schultz.Sh NAME
31d0f13633SDavid Schultz.Nm round ,
32d0f13633SDavid Schultz.Nm roundf
33d0f13633SDavid Schultz.Nd round to nearest integral value
34d0f13633SDavid Schultz.Sh LIBRARY
35d0f13633SDavid Schultz.Lb libm
36d0f13633SDavid Schultz.Sh SYNOPSIS
37d0f13633SDavid Schultz.In math.h
38d0f13633SDavid Schultz.Ft double
39d0f13633SDavid Schultz.Fn round "double x"
40d0f13633SDavid Schultz.Ft float
41d0f13633SDavid Schultz.Fn roundf "float x"
42d0f13633SDavid Schultz.Sh DESCRIPTION
43d0f13633SDavid SchultzThe
44d0f13633SDavid Schultz.Fn round
45d0f13633SDavid Schultzand
46d0f13633SDavid Schultz.Fn roundf
47d0f13633SDavid Schultzfunctions return the nearest integral value to
48d0f13633SDavid Schultz.Fa x ;
49d0f13633SDavid Schultzif
50d0f13633SDavid Schultz.Fa x
51d0f13633SDavid Schultzlies halfway between two integral values, then these
52d0f13633SDavid Schultzfunctions return the integral value with the larger
53d0f13633SDavid Schultzabsolute value (i.e., they round away from zero).
54d0f13633SDavid Schultz.Sh SEE ALSO
55d0f13633SDavid Schultz.Xr ceil 3 ,
56d0f13633SDavid Schultz.Xr floor 3 ,
57d0f13633SDavid Schultz.Xr ieee 3 ,
58d0f13633SDavid Schultz.Xr math 3 ,
59a9a0bf07SDavid Schultz.Xr rint 3 ,
60a9a0bf07SDavid Schultz.Xr trunc 3
61d0f13633SDavid Schultz.Sh STANDARDS
62d0f13633SDavid SchultzThe
63d0f13633SDavid Schultz.Fn round
64d0f13633SDavid Schultzfunction conforms to
65d0f13633SDavid Schultz.St -isoC-99 .
66d0f13633SDavid Schultz.Sh HISTORY
67d0f13633SDavid SchultzThe
68d0f13633SDavid Schultz.Fn round
69d0f13633SDavid Schultzand
70d0f13633SDavid Schultz.Fn roundf
71d0f13633SDavid Schultzfunctions appeared in
72d0f13633SDavid Schultz.Fx 5.3 .
73