C Tutorial/math.h/lrint
lrint
Item Value Header file math.h Declaration long int lrintf(float arg);long int lrint(double arg);long int lrintl(long double arg); Return returns the value of arg rounded to the nearest long integer.
#include <math.h>
#include <stdio.h>
int main(void)
{
double val = 1.0;
do {
printf("%f %f\n", val, lrint (val));
val++;
} while (val<11.0);
return 0;
}