Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Unified Diff: src/platform-posix.cc

Issue 20274002: Don't duplicate ceiling() for every POSIX platform. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698