Arithmetic
Flavio Lionel Rita edited this page Aug 31, 2022
·
1 revision
Operator | Description |
---|---|
- | negative /subtraction |
+ | addition |
* | multiplication |
/ | division |
** | exponentiation |
// | floorDivision |
% | mod |
Context:
const context = { a: '1', b: 2, c: { a: 4, b: 5 } }
Example | Result |
---|---|
3+2-1 | 4 |
3*4-1 | 11 |
1-2-5 | -6 |
(2+3)*2 | 10 |
2*(3+2) | 10 |
1+234 | 25 |
(1+(2**3)*4 | 33 |
1+2**(3*4) | 4097 |
(ab)+(2a+2*b) | 8 |
2**b+a | '41' |
c.b | 5 |
Negative:
- description: negative
- return: number
- params:
- value: number
Subtraction:
- description: subtraction
- return: number
- params:
- a: number
- b: number
- description: addition
- return: number
- params:
- a: number
- b: number
- description: multiplication
- return: number
- params:
- a: number
- b: number
- description: division
- return: number
- params:
- a: number
- b: number
- description: exponentiation
- return: number
- params:
- a: number
- b: number
- description: floorDivision
- return: number
- params:
- a: number
- b: number
- description: mod
- return: number
- params:
- a: number
- b: number
- Home
- Features
- Concepts
- Operators
- Functions
- Related Projects
- Source Code Documentation
- Change log