![]() |
![]() |
![]() |
![]() |
(..Operators..) | Contents | Index | (..Operators) |
Of course, SCARLET knows the four basic operators of arithmetic.
MulOp: | ||
* | Multiplication | |
% | Modulus | |
/ | Division |
AddOp: | ||
+ | Addition | |
- | Subtraction |
Their use does in no way differ from what we would expect; as usually they
operate on the set of integer expressions and
have integer expressions as results, too. Furthermore it should not be
surprising that divisions by zero are not allowed.
Please notice that all operations happen on a subset of
;
therefore,
the normal division has to be replaced with the integer division /,
which returns the integer part of the division,
and the modulus %, which returns the remainder.
7 % 31 7 / 3
2 7 % 3 + 7 / 3
3
+ and - have a second meaning as unary operators: in this case they are used as signs and stand right in front of the operand.
On top of everything, + works as a concatenation operator, if it is applied to two string expressions.
denotes the string expression that will emerge, if
StringExpression2 is attached to
StringExpression1.
Certainly the maximum string
length of 255 characters must not be exceeded in process.
"thousand "+ "five""thousand five"
![]() |
![]() |
![]() |
![]() |
(..Operators..) | Contents | Index | (..Operators) |