OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef PLATFORM_C99_SUPPORT_WIN_H_ | 5 #ifndef PLATFORM_C99_SUPPORT_WIN_H_ |
6 #define PLATFORM_C99_SUPPORT_WIN_H_ | 6 #define PLATFORM_C99_SUPPORT_WIN_H_ |
7 | 7 |
8 // Visual C++ is missing a bunch of C99 math macros and | 8 // Visual C++ is missing a bunch of C99 math macros and |
9 // functions. Define them here. | 9 // functions. Define them here. |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... | |
40 } | 40 } |
41 | 41 |
42 static inline double trunc(double x) { | 42 static inline double trunc(double x) { |
43 if (x < 0) { | 43 if (x < 0) { |
44 return ceil(x); | 44 return ceil(x); |
45 } else { | 45 } else { |
46 return floor(x); | 46 return floor(x); |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 static inline double round(double x) { | |
Mads Ager (google)
2012/11/28 09:26:26
We should still have the round method declared her
aam-me
2012/11/28 12:14:36
Done.
| |
51 if (x < 0) { | |
52 return ceil(x - 0.5); | |
53 } else { | |
54 return floor(x + 0.5); | |
55 } | |
56 } | |
57 | |
58 #endif // PLATFORM_C99_SUPPORT_WIN_H_ | 50 #endif // PLATFORM_C99_SUPPORT_WIN_H_ |
OLD | NEW |