diff options
author | Marius Kintel <marius@kintel.net> | 2013-08-20 03:26:05 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-08-20 03:26:05 (GMT) |
commit | 154c65dee2ccb77c9e7fc576c36067a24632fa30 (patch) | |
tree | 1f61d1f944152df00800017223845a4cb9a1d899 /src/mathc99.cc | |
parent | fe7fb45019affbf683930d6368fe38524bdd2649 (diff) | |
parent | 61e6178d1b71d78832aab4fbe7bd2d3550626b87 (diff) |
Merge branch 'master' of git://github.com/ivoknutsel/openscad into ivoknutsel-master
Diffstat (limited to 'src/mathc99.cc')
-rw-r--r-- | src/mathc99.cc | 6 |
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) {
|