.\" Copyright (c) 1985, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" %sccs.include.redist.man%
.\" @(#)rint.3 8.2 (Berkeley) %G%
.Nd round-to-closest integer functions
function finds the integer (represented as a double precision number)
in the direction of the prevailing rounding mode.
is equivalent to adding half to the magnitude
and then rounding towards zero.
In the default rounding mode, to nearest,
on a machine that conforms to
with the additional stipulation
Other rounding modes can make
Another way to obtain an integer near
.Bd -literal -offset indent
double x;\0\0\0\0 int k;\0\0\0\0k\0=\0x;
towards 0 to get the integer
first, whichever you intend.
Also note that, if x is larger than
can accommodate, the value of
and the presence or absence of an integer overflow are hard to