mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Use floor() to implement round() on WIN32 platform.
This change was suggested by Akira Kakuto.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user