gleam-lang / gleam-lang/stdlib
int.random behaviour
Open
- Dominant language
- Gleam
- Stars
- 710
- Forks
- 225
- Avg merge
- 5h 52m
- Merged PRs (30d)
- 3
Description
```gleam
pub fn random(min: Int, max: Int) -> Int
```
1. "min" and "max" can be used interchangeably, which is confusing to me. e.g. random(-1, 1) is the same as random(1, -1)
2. the maximum value is excluded from output (i.e. not the `max` but the actually higher value)
I'm not sure if this behaviour is intended, but at least it needs to be documented.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.