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

NAME

6       trunc, truncf, truncl - round to truncated integer value
7

SYNOPSIS

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

DESCRIPTION

22       These  functions round their argument to the integer value, in floating
23       format, nearest to but no larger in magnitude than the argument.
24

RETURN VALUES

26       Upon successful completion, these functions return the truncated  inte‐
27       ger value.
28
29
30       If x is NaN, a NaN is returned.
31
32
33       If x is ±0 or ±Inf, x is returned.
34

ERRORS

36       No errors are defined.
37

ATTRIBUTES

39       See attributes(5) for descriptions of the following attributes:
40
41
42
43
44       ┌─────────────────────────────┬─────────────────────────────┐
45       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
46       ├─────────────────────────────┼─────────────────────────────┤
47       │Interface Stability          │Standard                     │
48       ├─────────────────────────────┼─────────────────────────────┤
49       │MT-Level                     │MT-Safe                      │
50       └─────────────────────────────┴─────────────────────────────┘
51

SEE ALSO

53       math.h(3HEAD), attributes(5), standards(5)
54
55
56
57SunOS 5.11                        12 Jul 2006                        trunc(3M)
Impressum