1rint(3M)                Mathematical Library Functions                rint(3M)
2
3
4

NAME

6       rint, rintf, rintl - round-to-nearest integral value
7

SYNOPSIS

9       c99 [ flag... ] file... -lm [ library... ]
10       #include <math.h>
11
12       double rint(double x);
13
14
15       float rintf(float x);
16
17
18       long double rintl(long double x);
19
20

DESCRIPTION

22       These  functions  return  the  integral value (represented as a double)
23       nearest x in the direction of the current rounding mode.
24
25
26       If the current rounding mode rounds toward negative infinity, rint() is
27       equivalent  to  floor(3M).  If  the current rounding mode rounds toward
28       positive infinity, rint() is equivalent to ceil(3M).
29
30
31       These functions differ from the nearbyint(3M), nearbyintf(), and  near‐
32       byintl()  functions only in that they might raise the inexact floating-
33       point exception if the result differs in value from the argument.
34

RETURN VALUES

36       Upon successful completion, these functions return the integer  (repre‐
37       sented  as a double precision number) nearest x in the direction of the
38       current rounding mode.
39
40
41       If x is NaN, a NaN is returned.
42
43
44       If x is ±0 or ±Inf, x is returned.
45

ATTRIBUTES

47       See attributes(5) for descriptions of the following attributes:
48
49
50
51
52       ┌─────────────────────────────┬─────────────────────────────┐
53       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
54       ├─────────────────────────────┼─────────────────────────────┤
55       │Interface Stability          │Standard                     │
56       ├─────────────────────────────┼─────────────────────────────┤
57       │MT-Level                     │MT-Safe                      │
58       └─────────────────────────────┴─────────────────────────────┘
59

SEE ALSO

61       abs(3C),  ceil(3M),  feclearexcept(3M),  fetestexcept(3M),   floor(3M),
62       isnan(3M), math.h(3HEAD), nearbyint(3M), attributes(5), standards(5)
63
64
65
66SunOS 5.11                        12 Jul 2006                         rint(3M)
Impressum