Updated smnp.math (markdown)

Bartłomiej Przemysław Pluta
2020-03-27 18:08:15 +01:00
parent 4158bef959
commit e8068b14af

@@ -1,10 +1,11 @@
# Functions # Functions
## random ## random
``` ```
random(min: int, max: int) random(min: int, max: int) #1
random(min: float, max: float) random(min: float, max: float) #2
random() #3
``` ```
Returns a random number from a given range _exclusively_. Returns a random number from a given range _exclusively_ (`#1`, `#2`). Returns the random `float` value uniformly distributed between 0 (inclusive) and 1 (exclusive) if no argument passed (`#3`).
#### Output #### Output
* `int` if passed arguments are of `int` type * `int` if passed arguments are of `int` type
@@ -80,10 +81,4 @@ Returns a list contained of integers from `begin` (inclusive) to `end` (exclusiv
#### Example #### Example
``` ```
println(range(4, 20, 2)); # [4, 6, 8, 10, 12, 14, 16, 18] println(range(4, 20, 2)); # [4, 6, 8, 10, 12, 14, 16, 18]
``` ```
## random
```
random()
```
Gets the random `float` value uniformly distributed between 0 (inclusive) and 1 (exclusive).