1nearbyint(3M) Mathematical Library Functions nearbyint(3M)
2
3
4
6 nearbyint, nearbyintf, nearbyintl - floating-point rounding functions
7
9 c99 [ flag... ] file... -lm [ library... ]
10 #include <math.h>
11
12 double nearbyint(double x);
13
14
15 float nearbyintf(float x);
16
17
18 long double nearbyintl(long double x);
19
20
22 These functions round their argument to an integer value in floating-
23 point format, using the current rounding direction and without raising
24 the inexact floating-point exception.
25
27 Upon successful completion, these functions return the rounded integer
28 value.
29
30
31 If x is NaN, a NaN is returned.
32
33
34 If x is ±0, ±0 is returned.
35
36
37 If x is ±Inf, x is returned.
38
40 See attributes(5) for descriptions of the following attributes:
41
42
43
44
45 ┌─────────────────────────────┬─────────────────────────────┐
46 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
47 ├─────────────────────────────┼─────────────────────────────┤
48 │Interface Stability │Standard │
49 ├─────────────────────────────┼─────────────────────────────┤
50 │MT-Level │MT-Safe │
51 └─────────────────────────────┴─────────────────────────────┘
52
54 feclearexcept(3M), fetestexcept(3M), math.h(3HEAD), attributes(5),
55 standards(5)
56
57
58
59SunOS 5.11 12 Jul 2006 nearbyint(3M)