From 0bcf53e06efc687115c096ff9cadc41316eb95cf Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 18 Jan 2012 23:33:27 +1000 Subject: Add a note about Lua truth values. --- LuaSL/src/LuaSL_compile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 3dea80c..b9d6d48 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c @@ -671,6 +671,7 @@ QUIRK - I have seen cases where a double explicit typecast was needed in SL, but Any binary operation involving a float and an integer implicitly casts the integer to float. A boolean operation deals with TRUE (1) and FALSE (0). Any non zero value is a TRUE (generally sigh). +On the other hand, in Lua, only false and nil are false, everything else is true. Bitwise operations only apply to integers. The shifts are arithmatic, not logical. Right shifted bits are dropped, left shifts the sign bit. integer = integer0 % integer1; // Apparently only applies to integers, but works fine on floats in OS. -- cgit v1.1