]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>. |
2 | .\" | |
3 | .\" Permission is granted to make and distribute verbatim copies of this | |
4 | .\" manual provided the copyright notice and this permission notice are | |
5 | .\" preserved on all copies. | |
6 | .\" | |
7 | .\" Permission is granted to copy and distribute modified versions of this | |
8 | .\" manual under the conditions for verbatim copying, provided that the | |
9 | .\" entire resulting derived work is distributed under the terms of a | |
10 | .\" permission notice identical to this one. | |
c13182ef | 11 | .\" |
fea681da MK |
12 | .\" Since the Linux kernel and libraries are constantly changing, this |
13 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
14 | .\" responsibility for errors or omissions, or for damages resulting from | |
15 | .\" the use of the information contained herein. The author(s) may not | |
16 | .\" have taken the same level of care in the production of this manual, | |
17 | .\" which is licensed free of charge, as they might when working | |
18 | .\" professionally. | |
c13182ef | 19 | .\" |
fea681da MK |
20 | .\" Formatted or processed versions of this manual, if unaccompanied by |
21 | .\" the source, must acknowledge the copyright and authors of this work. | |
22 | .\" | |
23 | .TH CEIL 3 2001-05-31 "" "Linux Programmer's Manual" | |
24 | .SH NAME | |
c13182ef | 25 | ceil, ceilf, ceill \- ceiling function: smallest integral value not |
35478399 | 26 | less than argument |
fea681da MK |
27 | .SH SYNOPSIS |
28 | .nf | |
29 | .B #include <math.h> | |
30 | .sp | |
31 | .BI "double ceil(double " x ); | |
32 | .br | |
33 | .BI "float ceilf(float " x ); | |
34 | .br | |
35 | .BI "long double ceill(long double " x ); | |
36 | .fi | |
37 | .sp | |
e9329f6d | 38 | Link with \fI-lm\fP. |
fea681da MK |
39 | .SH DESCRIPTION |
40 | These functions round \fIx\fP up to the nearest integer. | |
41 | .SH "RETURN VALUE" | |
c13182ef MK |
42 | The rounded integer value. |
43 | If \fIx\fP is integral or infinite, | |
fea681da MK |
44 | \fIx\fP itself is returned. |
45 | .SH ERRORS | |
c8fe3fa2 MK |
46 | No errors other than |
47 | .B EDOM | |
48 | and | |
49 | .B ERANGE | |
50 | can occur. | |
fea681da MK |
51 | If \fIx\fP is NaN, then NaN is returned and |
52 | .I errno | |
a9b4ebbc MK |
53 | may be set to |
54 | .BR EDOM . | |
2b2581ee MK |
55 | .SH "CONFORMING TO" |
56 | The | |
57 | .BR ceil () | |
58 | function conforms to SVr4, POSIX.1-2001, 4.3BSD, C89, C99. | |
59 | The other functions are from C99. | |
fea681da | 60 | .SH NOTES |
68e1685c | 61 | SUSv2 and POSIX.1-2001 contain text about overflow (which might set |
fea681da | 62 | .I errno |
a9b4ebbc MK |
63 | to |
64 | .BR ERANGE , | |
65 | or raise an exception). | |
fea681da MK |
66 | In practice, the result cannot overflow on any current machine, |
67 | so this error-handling stuff is just nonsense. | |
68 | (More precisely, overflow can happen only when the maximum value | |
69 | of the exponent is smaller than the number of mantissa bits. | |
70 | For the IEEE-754 standard 32-bit and 64-bit floating point numbers | |
71 | the maximum value of the exponent is 128 (resp. 1024), and the number | |
72 | of mantissa bits is 24 (resp. 53).) | |
fea681da MK |
73 | .SH "SEE ALSO" |
74 | .BR floor (3), | |
75 | .BR lrint (3), | |
76 | .BR nearbyint (3), | |
77 | .BR rint (3), | |
78 | .BR round (3), | |
79 | .BR trunc (3) |