diff options
author | inoas <mail@inoas.com> | 2022-04-12 00:10:53 +0200 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2022-04-16 10:23:34 +0100 |
commit | 80fc4269867e514c813526eec302d3695b5a023b (patch) | |
tree | cd4119db88cce6ce27b65a604d890c0acd8f7d74 /src | |
parent | 486ee7a8bb1638a3a3d84ae0fc7f7424b0ce5d12 (diff) | |
download | gleam_stdlib-80fc4269867e514c813526eec302d3695b5a023b.tar.gz gleam_stdlib-80fc4269867e514c813526eec302d3695b5a023b.zip |
comments
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/float.gleam | 2 | ||||
-rw-r--r-- | src/gleam/int.gleam | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gleam/float.gleam b/src/gleam/float.gleam index 20fd6c8..6f19b13 100644 --- a/src/gleam/float.gleam +++ b/src/gleam/float.gleam @@ -351,7 +351,7 @@ if javascript { pub fn random_between(min: Float, max: Float) -> Float { // ```javascript - // return Math.floor(Math.random() * (max - min + 1) + min); // The maximum is/shuould-be exclusive + // return Math.floor(Math.random() * (max - min + 1) + min); // The maximum is/should-be exclusive // ``` // See: <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#getting_a_random_number_between_two_values> random_uniform() *. { max -. min } +. min diff --git a/src/gleam/int.gleam b/src/gleam/int.gleam index 9da5c97..418d4fb 100644 --- a/src/gleam/int.gleam +++ b/src/gleam/int.gleam @@ -398,7 +398,7 @@ pub fn random_between(min: Int, max: Int) -> Int { // ```javascript // min = Math.ceil(min); // max = Math.floor(max); - // return Math.floor(Math.random() * (max - min + 1) + min); //The maximum is + // return Math.floor(Math.random() * (max - min + 1) + min); //The maximum is inclusive and the minimum is inclusive // ``` // See: <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#getting_a_random_integer_between_two_values> float.random_between(to_float(min), to_float(max)) |