summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-15 00:45:38 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-09-07 20:08:01 +0900
commitc449b9b02f63cf8268a0eb9639a43caf4598996d (patch)
tree6765aba80338204e06f753fdf1c039b9f3691d25 /random.c
parentaf5e87ab218c5f4e34c6cdb54ae119a7f0f9033f (diff)
Added rb_int_pair_to_real
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3024
Diffstat (limited to 'random.c')
-rw-r--r--random.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/random.c b/random.c
index 08c6918..3fef5ce 100644
--- a/random.c
+++ b/random.c
@@ -992,6 +992,12 @@ random_real(VALUE obj, rb_random_t *rnd, int excl)
a = random_int32(rng, rnd);
b = random_int32(rng, rnd);
}
+ return rb_int_pair_to_real(a, b, excl);
+}
+
+double
+rb_int_pair_to_real(uint32_t a, uint32_t b, int excl)
+{
if (excl) {
return int_pair_to_real_exclusive(a, b);
}