trunc3
Nearest integral value with magnitude less than or equal to |x|
Usage
#include <math.h>
double
trunc(double x);
float
truncf(float x);
long double
truncl(long double x);
Library
Math Library (libm, -lm)
Overview
The trunc(), truncf(), and truncl() functions return the nearest integral value with magnitude less than or equal to |x|. They are equivalent to rint(), rintf(), and rintl(), respectively, in the FE_TOWARDZERO rounding mode.
Releases
52 releases since FreeBSD 5.3-RELEASE; the text changed 33 times.