xref: /minix3/lib/libm/man/lrint.3 (revision 2fe8fb192fe7e8720e3e7a77f928da545e872a6a)
1.\" $NetBSD: lrint.3,v 1.1 2005/09/16 15:26:47 wiz Exp $
2.\"
3.\" Copyright (c) 2005 David Schultz <das@FreeBSD.org>
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD: /repoman/r/ncvs/src/lib/msun/man/lrint.3,v 1.2.2.2 2005/03/01 16:18:39 brueffer Exp $
28.\"
29.Dd January 11, 2005
30.Dt LRINT 3
31.Os
32.Sh NAME
33.Nm llrint ,
34.Nm llrintf ,
35.Nm lrint ,
36.Nm lrintf
37.Nd convert to integer
38.Sh LIBRARY
39.Lb libm
40.Sh SYNOPSIS
41.In math.h
42.Ft long long
43.Fn llrint "double x"
44.Ft long long
45.Fn llrintf "float x"
46.Ft long
47.Fn lrint "double x"
48.Ft long
49.Fn lrintf "float x"
50.Sh DESCRIPTION
51The
52.Fn lrint
53function returns the integer nearest to its argument
54.Fa x
55according to the current rounding mode.
56.Pp
57The
58.Fn llrint ,
59.Fn llrintf ,
60and
61.Fn lrintf
62functions differ from
63.Fn lrint
64only in their input and output types.
65.Sh RETURN VALUES
66The
67.Nm llrint ,
68.Nm llrintf ,
69.Nm lrint ,
70and
71.Nm lrintf
72functions return the integer nearest to their argument
73.Fa x
74according to the current rounding mode.
75If the rounded result is too large to be represented as a
76.Vt long long
77or
78.Vt long
79value, respectively,
80.\" an invalid exception is raised and
81the return value is undefined.
82.\" Otherwise, if
83.\" .Fa x
84.\" is not an integer,
85.\" .Fn lrint
86.\" raises an inexact exception.
87.\" If
88.\" .Fa x
89.\" is too large, a range error may occur.
90.Sh SEE ALSO
91.\" .Xr lround 3 ,
92.Xr math 3 ,
93.Xr rint 3 ,
94.Xr round 3
95.Sh STANDARDS
96The
97.Fn llrint ,
98.Fn llrintf ,
99.Fn lrint ,
100and
101.Fn lrintf
102functions conform to
103.St -isoC-99 .
104