Difference between revisions of "Logic"

From WikiManual
Jump to: navigation, search
(Logic:)
Line 2: Line 2:
  
 
===Logic:===
 
===Logic:===
Logic operators compare two variables on the stack and replace them with a 0 or a 1 on the stack depending on what operator was used and how many of the variables have ben 0.
+
Logic operators perform boolean operations on values on the boolean stack, popping them off the stack in the process and pushing the result onto the stack, either true or false.  The result obviously will depend upong the operator was used and the boolean values on the stack at the time.
 
 
All (but [[not]]) return a 1 if at least one of both variables on the stack was not 0.  
 
The choosen logic operator mostly exists for situations if both variables are 0 or both are not 0 or if only one of them is 0.
 
{{Is that true?}}
 
  
 
===Energy Cost:===
 
===Energy Cost:===
 
Since version: 2.4 you can set an Energy cotst per bitwise command instance. default is 0.
 
Since version: 2.4 you can set an Energy cotst per bitwise command instance. default is 0.

Revision as of 15:19, 10 November 2007

Logic:

true
false
and
or
not
xor

Logic:

Logic operators perform boolean operations on values on the boolean stack, popping them off the stack in the process and pushing the result onto the stack, either true or false. The result obviously will depend upong the operator was used and the boolean values on the stack at the time.

Energy Cost:

Since version: 2.4 you can set an Energy cotst per bitwise command instance. default is 0.