Operators |
|
Arithmetic OperatorsFractal Science Kit programs support the following arithmetic operators: + Addition All of the arithmetic operators, with the exception of the modulus operator, operate on complex operands and return a complex result. The modulus operator operates on real operands and returns a real result. The modulus operator divides its 1st operand by its 2nd operand, and returns the remainder as its result. Comparison OperatorsFractal Science Kit programs support the following comparison operators: = Equal To The operators = and <>, operate on complex operands and return a Boolean result. The remaining operators (<=, <, >=, >), operate on real operands and return a Boolean result. Logical OperatorsFractal Science Kit programs support the following logical operators: || Logical OR These logical operators operate on Boolean operands and return a Boolean result. Operator PrecedenceOperator precedence is used to determine how to evaluate expressions involving multiple operations where parentheses are not present to guide the compiler. Operators with the highest precedence are evaluated first, followed by operators of the next highest precedence, and so on, until the expression is resolved. Of course, parentheses can be used to dictate order, and are recommended if the clarity of the expression is improved. The following table lists the operators in highest to lowest precedence: ^ Operators on the same row have the same precedence. When several operators of the same precedence are combined in an expression, they are evaluated left to right. The operators ~, ||, &&, <=, <, >=, >, and %, operate only on the real component of the operands and the result of evaluating one of these operators produces a real result (i.e., the imaginary component is 0). The operators = and <> operate on complex operands but return a real result (i.e., the imaginary component is 0). Example: z = a*b*c
' z = (a*b)*c In the above example, the trailing comments provide functionally equivalent statements to those to the left of the comments. |
Copyright © 2004-2019 Ross Hilbert |