Index: runtime/platform/c99_support_win.cc |
diff --git a/runtime/platform/c99_support_win.cc b/runtime/platform/c99_support_win.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..00864c009748e5a18f504eaa72fc59a1bde770af |
--- /dev/null |
+++ b/runtime/platform/c99_support_win.cc |
@@ -0,0 +1,24 @@ |
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
Mads Ager (google)
2012/11/28 09:26:26
Just move your new implementation to c99_support_w
aam-me
2012/11/28 12:14:36
Done.
|
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+#include <math.h> |
+ |
+#include "platform/c99_support_win.h" |
+ |
+double round(double x) { |
+ if (!_finite(x)) { |
+ return x; |
+ } |
+ |
+ double intpart; |
+ double fractpart = modf(x, &intpart); |
+ |
+ if (fractpart >= 0.5) { |
+ return intpart + 1; |
+ } else if (fractpart > -0.5) { |
+ return intpart; |
+ } else { |
+ return intpart - 1; |
+ } |
+} |