aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-18 23:33:27 +1000
committerDavid Walter Seikel2012-01-18 23:33:27 +1000
commit0bcf53e06efc687115c096ff9cadc41316eb95cf (patch)
tree17c9a2e5071fb57830312b51f33170f658546bfd
parentMake sure allocated memory is all initialized properly. (diff)
downloadSledjHamr-0bcf53e06efc687115c096ff9cadc41316eb95cf.zip
SledjHamr-0bcf53e06efc687115c096ff9cadc41316eb95cf.tar.gz
SledjHamr-0bcf53e06efc687115c096ff9cadc41316eb95cf.tar.bz2
SledjHamr-0bcf53e06efc687115c096ff9cadc41316eb95cf.tar.xz
Add a note about Lua truth values.
-rw-r--r--LuaSL/src/LuaSL_compile.c1
1 files changed, 1 insertions, 0 deletions
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
671Any binary operation involving a float and an integer implicitly casts the integer to float. 671Any binary operation involving a float and an integer implicitly casts the integer to float.
672 672
673A boolean operation deals with TRUE (1) and FALSE (0). Any non zero value is a TRUE (generally sigh). 673A boolean operation deals with TRUE (1) and FALSE (0). Any non zero value is a TRUE (generally sigh).
674On the other hand, in Lua, only false and nil are false, everything else is true.
674Bitwise operations only apply to integers. The shifts are arithmatic, not logical. Right shifted bits are dropped, left shifts the sign bit. 675Bitwise operations only apply to integers. The shifts are arithmatic, not logical. Right shifted bits are dropped, left shifts the sign bit.
675 676
676integer = integer0 % integer1; // Apparently only applies to integers, but works fine on floats in OS. 677integer = integer0 % integer1; // Apparently only applies to integers, but works fine on floats in OS.