-
Notifications
You must be signed in to change notification settings - Fork 1
Mathematical operators
Jean Dubois edited this page Mar 19, 2022
·
8 revisions
Here are the mathematical operators avaible in Nougaro (ordored by priority) :
Nougaro | Python | Comments |
---|---|---|
^ | ** | power |
* | * | multiplication |
% | % | modulo |
/ | / | division |
// | // | floor division |
+ | + | addition |
- | - | substraction |
It respects operation priority and you can use parenthesis.
-
3 * 4
returns 12 -
4 / 2
returns 2 -
1 + 1
returns 2 -
3 - 4
returns -1 -
10 % 7
returns 3 -
10 % 3
returns 1 -
10 // 7
returns 1 -
10 // 3
returns 3 -
5 ^ 2
returns 25 -
5 + 5 * 3 + 2
returns 22 -
(5 + 5) * (3 + 2)
returns 50