Use floor() to implement round() on WIN32 platform.

This change was suggested by Akira Kakuto.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-07-13 20:32:34 +09:00
parent 70e99d6b57
commit bad807e7f0
+1 -6
View File
@@ -20,12 +20,7 @@
#if defined(_MSC_VER) && _MSC_VER < 1800
double round(double x) {
if (x >= 0.0) {
return (double)((int)(x + 0.5));
}
else {
return (double)((int)(x - 0.5));
}
return floor(x + 0.5);
}
#endif