aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinoas <mail@inoas.com>2022-04-13 02:50:20 +0200
committerLouis Pilfold <louis@lpil.uk>2022-04-16 10:23:34 +0100
commit3402ff3617bcc12365a20e6f24c5e007656836e6 (patch)
tree7b37136ba9953624ef6c13ec33e9cdd943023f3f
parent620a564dbd0fc75f66ec2abcbbac5a56543cb5c5 (diff)
downloadgleam_stdlib-3402ff3617bcc12365a20e6f24c5e007656836e6.tar.gz
gleam_stdlib-3402ff3617bcc12365a20e6f24c5e007656836e6.zip
cs
-rw-r--r--src/gleam_stdlib.mjs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gleam_stdlib.mjs b/src/gleam_stdlib.mjs
index 6604bff..1286469 100644
--- a/src/gleam_stdlib.mjs
+++ b/src/gleam_stdlib.mjs
@@ -247,17 +247,17 @@ export function power(base, exponent) {
}
export function random_uniform() {
- let random_uniform_result = Math.random();
- // With round-to-nearest-even behavior, the ranges claimed for the functions below
+ let random_uniform_result = Math.random();
+ // With round-to-nearest-even behavior, the ranges claimed for the functions below
// (excluding the one for Math.random() itself) aren't exact.
// If extremely large bounds are chosen (2^53 or higher),
// it's possible in extremely rare cases to calculate the usually-excluded upper bound.
// Note that as numbers in JavaScript are IEEE 754 floating point numbers
// See: <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random>
- // Because of this, we just loop 'until' we get a valid result where 0.0 <= x < 1.0:
- if (random_uniform_result === 1.0) {
- return random_uniform();
- }
+ // Because of this, we just loop 'until' we get a valid result where 0.0 <= x < 1.0:
+ if (random_uniform_result === 1.0) {
+ return random_uniform();
+ }
return random_uniform_result;
}