Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 |
both |
#define _XOPEN_SOURCE_EXTENDED 1
#include <math.h>
double rint(double x);
#define _ISOC99_SOURCE
#include <math.h>
float rintf(float x);
long double rintl(long double x);
#define _TR1_C99
#include <math.h>
float rint(float x);
long double rint(long double x);
Function | Hex | IEEE |
---|---|---|
rint | X | X |
rintf | X | X |
rintl | X | X |
rint() is always successful in IEEE.
Special behavior for hex: The rint() functions always round toward zero in hexadecimal math.