Everything

round / roundf / roundl


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

[Format]

#include <math.h>

double round(double d);

float roundf(float d);

long double roundl(long double d);

[Parameters]

d Value to be rounded to an integer

[Return values]

Normal: d rounded to an integer

Abnormal: Range error: Returns an undetermined value.

[Remarks]

A range error may occur if the absolute value of d is too large.