-
Notifications
You must be signed in to change notification settings - Fork 0
Arithmetic Operators
Michael edited this page Mar 30, 2021
·
2 revisions
As written, AVBEEL only supports integers, although this can be easily changed. To make an integer, just write it!
Enter Code: 1
Time: <11ms
Result: 1
There are four integer operators: +
, -
, *
, and /
There are no parentheses, as AVBEEL uses Polish Notation:
Enter Code: + 1 1
Time: <0ms
Result: 2
In AVBEEL, functions run from right to left, so *
is triggered before -
. The following statement means: The product of 2 and 3, minus 1.
- * 2 3 1
==-> - (* 2 3) 1
-> - 6 1
-> 5
(parentheses added for clarity)
Enter Code: - * 2 3 1
Time: <5ms
Result: 5
As these are integer operators, integer division is used:
Enter Code: / 5 2
Time: <5ms
Result: 2