Appendix B: Logic Block Gates
The seven gates are identical to one another. Each has an input from the top and an input from the side. For non-commutative operations the top input is the 'left' input and the side input is the 'right' input. For example, the Arithmetic Minus operation subtracts the side from the top.
If the gate requires a logical value or an integer as an input then it translates the input as described in Logic Block Values.
Copy From Top
The default.
Top input and result are strings. Side input is ignored. Result = The value from the top input. Side input ignored
Copy From Side
Side input and result are strings. Top input ignored. Result = The value from the side input. Top input is ignored.
Logical AND
Top and side inputs and result are logical values. Result is true if both top is true and side is true.
Logical OR
Top and side inputs and result are logical values. Result is true if either top is true or side is true (or both are true).
Numeric Plus
Top and side inputs and result are integers. Result is the ordinary addition you learned in grade school.
Numeric Minus
Top and side inputs and result are integers. Result = ordinary subtraction. Top input minus side input.
Numeric Multiply
Top and side inputs are integers. Result is integer. Ordinary multiplication.
Numeric Divide
Top and side and result are integers. Signed division. Top divided by side. Mathematicians beware....the result of dividing -5 by 3 is -1. Any remainder has the same sign as the dividend. You should also know that this division is done on the strings of digits and is therefore quite slow. Dividing a 60-digit number by a 30-digit number to get a 30-digit quotient requires about 900 microseconds on my lowly Pentium 166.
Numeric Modulo
Top and side and result are integers. Result is the remainder when the top is divided by the side. Again, mathematicians beware....the remainder has the same sign as the dividend. For example, -8 modulo 3 is -2. Also, see warning about speed in description of Numeric Divide.
Numeric Greater
Top and side inputs are integers. Result is logical true or false. Result is true if top input is greater than side input.
GREP
Top input and side inputs are strings. Result is a string. Result is the substring of the top input matched by the grep expression from the side input. You might use this to search an item list for a particular item. Examples:
• "This is odd" GREP "odd" = "odd"
• "abcdefghijklmnop" GREP "e.*l" = "efghijkl"
• "/Axe//arrow//pipe bomb/" GREP "/arrow/" = "/arrow/"
See the GPDL topic Regular Expressions for more details.
Force True
Result is logical. Both inputs are ignored. Result is "1", the representation of true.
Force False
Result is logical. Both inputs are ignored.
Result is false, the empty string.
String Equal
Both inputs are strings. Result is logical.
Result is true if the two strings are identical. Absolutely identical. Case is significant. Spaces are significant.
What do you need?
Causes an error in editor. It is here to remind you that you have to ask the developers to implement what you need to get your job done.