From: ShadowNinja Date: Fri, 16 Oct 2015 16:52:24 +0000 (-0400) Subject: Fix myfloor(0.0) X-Git-Tag: 0.4.16~139 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c6e96c645b9f114ef12f814bea62d9a9b78064cf;p=oweals%2Fminetest.git Fix myfloor(0.0) --- 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; \