38 строки
333 B
Markdown
38 строки
333 B
Markdown
|
# Math
|
||
|
|
||
|
[Numeric](/reference/types/number) values: 0, 1, 2, ...
|
||
|
|
||
|
```blocks
|
||
|
0;
|
||
|
1;
|
||
|
2;
|
||
|
```
|
||
|
|
||
|
Arithmetic binary operation (+, -, *, /)
|
||
|
|
||
|
```blocks
|
||
|
0+1;
|
||
|
0-1;
|
||
|
1*2;
|
||
|
3/4;
|
||
|
```
|
||
|
|
||
|
Absolute value
|
||
|
|
||
|
```blocks
|
||
|
Math.abs(-5);
|
||
|
```
|
||
|
|
||
|
Minimum/maximum of two values
|
||
|
|
||
|
```blocks
|
||
|
Math.min(0, 1);
|
||
|
Math.max(0, 1);
|
||
|
```
|
||
|
|
||
|
Random value
|
||
|
|
||
|
```blocks
|
||
|
Math.random(5);
|
||
|
```
|