summaryrefslogtreecommitdiff
path: root/src/mathc99.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-08-20 03:26:05 (GMT)
committerMarius Kintel <marius@kintel.net>2013-08-20 03:26:05 (GMT)
commit154c65dee2ccb77c9e7fc576c36067a24632fa30 (patch)
tree1f61d1f944152df00800017223845a4cb9a1d899 /src/mathc99.cc
parentfe7fb45019affbf683930d6368fe38524bdd2649 (diff)
parent61e6178d1b71d78832aab4fbe7bd2d3550626b87 (diff)
Merge branch 'master' of git://github.com/ivoknutsel/openscad into ivoknutsel-master
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