1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #include "cdefs-compat.h"
- #include <openlibm_math.h>
- #include "math_private.h"
- OLM_DLLEXPORT float
- roundf(float x)
- {
- float t;
- if (!isfinite(x))
- return (x);
- if (x >= 0.0) {
- t = floorf(x);
- if (t - x <= -0.5)
- t += 1.0;
- return (t);
- } else {
- t = floorf(-x);
- if (t + x <= -0.5)
- t += 1.0;
- return (-t);
- }
- }
|