summaryrefslogtreecommitdiff
path: root/src/mathc99.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-08-21 05:40:25 (GMT)
committerMarius Kintel <marius@kintel.net>2013-08-21 05:40:25 (GMT)
commit7db45a878b29788ff846eac7dedede294836a1bc (patch)
treef9e01f3aaf86006d195f7bc58488150c7e619009 /src/mathc99.cc
parenta7396cc36fbd2269bc75b0632e659dd05149259b (diff)
parentf25ad73ea5fcc2abcf92d7cd1fbe44c072acd1f4 (diff)
Merge branch 'master' of github.com:openscad/openscad
Diffstat (limited to 'src/mathc99.cc')
-rw-r--r--src/mathc99.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mathc99.cc b/src/mathc99.cc
index 335446e..13f4c64 100644
--- a/src/mathc99.cc
+++ b/src/mathc99.cc
@@ -3,8 +3,12 @@
#ifdef WIN32
#include <algorithm>
+double trunc(double a) {
+ return (a >= 0) ? floor(a) : ceil(a);
+}
+
double round(double a) {
- return a > 0 ? floor(a+0.5) : ceil(a-0.5);
+ return a < 0 ? ceil(a - 0.5f) : floor(a + 0.5f);
}
float fmin(float a, float b) {
contact: Jan Huwald // Impressum