header file: math.h
double rint(double x);
float rintf(float x);
header file: math_u.h
double rint(double x);
float rintf(float x);
These two functions round to integral value in floating-point
format.
These functions are not part of the available Windows functions.
A zip file containing useful math functions is provided which
contains these functions. The zip file can be obtained at the link
listed at the bottom of this page (More Information).
An include file (math_u.h) for setting prototypes and macro
definitions is provided with the zip file.
Example of Use in Windows
#include <math_u.h>
double mydouble, drounded;
float myfloat, frounded;
drounded = rint(mydouble);
frounded = rintf(myfloat);