TeleFlow BasicScript AndOrXorNot

TeleFlow BasicScript AndOrXorNot

From TeleFlow

(Difference between revisions)
Jump to: navigation, search
Current revision (23:46, 19 May 2008) (edit) (undo)
 
Line 1: Line 1:
AND, OR, XOR and NOT are logical operators performing element-wise logic, returning true (nonzero) or false (zero) as follows:<br>
AND, OR, XOR and NOT are logical operators performing element-wise logic, returning true (nonzero) or false (zero) as follows:<br>
<br>
<br>
 +
===Syntax===
<b>AND:</b> if both values on the left and the right side of the operator are different from zero, then AND returns one, otherwise it returns zero.<br>
<b>AND:</b> if both values on the left and the right side of the operator are different from zero, then AND returns one, otherwise it returns zero.<br>
<br>
<br>
Line 9: Line 10:
<b>NOT:</b> if the value on the right side of this operator is zero, NOT returns one, otherwise it returns zero.<br>
<b>NOT:</b> if the value on the right side of this operator is zero, NOT returns one, otherwise it returns zero.<br>
<br>
<br>
-
<b>Examples:</b><br>
+
===Related Steps===
-
<br>
+
[[Image:Iv_517.gif]] [[TeleFlow_Step_0517|BasicScript]]<br>
-
BasicScript code<br>
+
-
<br>
+
-
print (3 AND 2)<br>
+
-
:1<br>
+
-
<br>
+
-
print (3 OR 2)<br>
+
-
:1<br>
+
-
<br>
+
-
print (3 XOR 2)<br>
+
-
:0<br>
+
-
<br>
+
-
print (3 NOT 2)<br>
+
-
:0<br>
+
<br>
<br>
 +
===Examples===
 +
:{| border="0" cellspacing="0" cellpadding="2" align="left"
 +
! BasicScript code &nbsp;&nbsp;&nbsp;&nbsp;
 +
! Result
 +
|-
 +
|print (3 AND 2)
 +
|1
 +
|-
 +
|print (3 OR 2)
 +
|1
 +
|-
 +
|print (3 XOR 2)
 +
|0
 +
|-
 +
|print (3 NOT 2)
 +
|0
 +
|-
 +
|}

Current revision

AND, OR, XOR and NOT are logical operators performing element-wise logic, returning true (nonzero) or false (zero) as follows:

Syntax

AND: if both values on the left and the right side of the operator are different from zero, then AND returns one, otherwise it returns zero.

OR: if at least one value from the left or the right side of the operator is different from zero, then OR returns one, otherwise it returns zero.

XOR: if one and only one value from the left or the right side of the operator is different from zero, then OR returns one, otherwise it returns zero.

NOT: if the value on the right side of this operator is zero, NOT returns one, otherwise it returns zero.

Related Steps

Image:Iv_517.gif BasicScript

Examples

BasicScript code      Result
print (3 AND 2) 1
print (3 OR 2) 1
print (3 XOR 2) 0
print (3 NOT 2) 0