Everything

trunc / truncf / truncl


Rounds a floating-point number to the nearest integer in the floating-point representation.

[Format]

#include <math.h>

double trunc(double d);

float truncf(float d);

long double truncl(long double d);

[Parameters]

d Value to be rounded to an integer in the floating-point representation

[Return values]

d truncated to an integer in the floating-point format

[Remarks]

The trunc function group rounds d so that the absolute value after rounding is not greater than the absolute value of d.