projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
77597c4
)
Fix myfloor(0.0)
author
ShadowNinja
<shadowninja@minetest.net>
Fri, 16 Oct 2015 16:52:24 +0000
(12:52 -0400)
committer
ShadowNinja
<shadowninja@minetest.net>
Sat, 6 May 2017 20:10:03 +0000
(16:10 -0400)
src/util/numeric.h
patch
|
blob
|
history
diff --git
a/src/util/numeric.h
b/src/util/numeric.h
index 0954b715154831167ccd27053af5541f45bc4d82..4a27f657d23faab74a8a82d584f97c278b4906fc 100644
(file)
--- 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; \