Chromium Code Reviews| Index: src/platform-posix.cc |
| diff --git a/src/platform-posix.cc b/src/platform-posix.cc |
| index 864e94c7e4f6896d61da24714332f3e2d55b35c8..6ac507204f966e4ea21610ca73d4dab0aa1f7e3e 100644 |
| --- a/src/platform-posix.cc |
| +++ b/src/platform-posix.cc |
| @@ -210,6 +210,16 @@ void OS::DebugBreak() { |
| // ---------------------------------------------------------------------------- |
| // Math functions |
| +double ceiling(double x) { |
| + // Correct buggy 'ceil' on some systems (i.e. FreeBSD, OS X) |
| + if (-1.0 < x && x < 0.0) { |
|
Sven Panne
2013/07/25 08:32:46
A ternary expresses the functional nature a bit mo
|
| + return -0.0; |
| + } else { |
| + return ceil(x); |
| + } |
| +} |
| + |
| + |
| double modulo(double x, double y) { |
| return fmod(x, y); |
| } |