TRUNC(3) Linux Programmer's Manual TRUNC(3)

trunc, truncf, truncl - round to integer, towards zero

#include <math.h>

double trunc(double x);

float truncf(float x);

long double truncl(long double x);

Link with -lm.


Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

trunc(), truncf(), truncl(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or cc -std=c99

These functions round x to the nearest integer not larger in absolute value.

The rounded integer value. If x is integral, infinite or NaN, x itself is returned.

None.

C99.

ceil(3), floor(3), lrint(3), nearbyint(3), rint(3), round(3)

This page is part of release 2.69 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.

2007-07-26

Different Versions of this Page: