aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2015-10-16 12:52:24 -0400
committerShadowNinja <shadowninja@minetest.net>2017-05-06 16:10:03 -0400
commitc6e96c645b9f114ef12f814bea62d9a9b78064cf (patch)
treeaf6cc5c296ec2502a60f08805c85512a1911bf2b /src
parent77597c4ff3b666cc37dd257952938df48d7e6f09 (diff)
downloadminetest-c6e96c645b9f114ef12f814bea62d9a9b78064cf.tar.gz
minetest-c6e96c645b9f114ef12f814bea62d9a9b78064cf.tar.bz2
minetest-c6e96c645b9f114ef12f814bea62d9a9b78064cf.zip
Fix myfloor(0.0)
Diffstat (limited to 'src')
-rw-r--r--src/util/numeric.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/numeric.h b/src/util/numeric.h
index 0954b7151..4a27f657d 100644
--- a/src/util/numeric.h
+++ b/src/util/numeric.h
@@ -28,7 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "../threading/mutex.h"
#define rangelim(d, min, max) ((d) < (min) ? (min) : ((d) > (max) ? (max) : (d)))
-#define myfloor(x) ((x) > 0.0 ? (int)(x) : (int)(x) - 1)
+#define myfloor(x) ((x) < 0.0 ? (int)(x) - 1 : (int)(x))
// The naive swap performs better than the xor version
#define SWAP(t, x, y) do { \
t temp = x; \