Commit 4c98c483 authored by Alex Converse's avatar Alex Converse Committed by Yaowu Xu

Add roundf and lroundf replacements for VS < 2013.

Change-Id: I25678279ab44672acf680bf04d9c551156e2904b
parent 3b0b222c
......@@ -27,6 +27,20 @@ static INLINE double round(double x) {
else
return floor(x + 0.5);
}
static INLINE float roundf(float x) {
if (x < 0)
return (float)ceil(x - 0.5f);
else
return (float)floor(x + 0.5f);
}
static INLINE long lroundf(float x) {
if (x < 0)
return (long)(x - 0.5f);
else
return (long)(x + 0.5f);
}
#endif // _MSC_VER < 1800
#endif // _MSC_VER
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment