summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-15 00:52:08 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-09-07 20:08:01 +0900
commitd6ec0ef59b4c7c95beaad09f77cb5f86a0901b97 (patch)
tree66d692d6abe2f2bb3c7c620544ba266b578d7909 /random.c
parentc449b9b02f63cf8268a0eb9639a43caf4598996d (diff)
Added `get_real` interface
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3024
Diffstat (limited to 'random.c')
-rw-r--r--random.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/random.c b/random.c
index 3fef5cea3b..75f4dbaa21 100644
--- a/random.c
+++ b/random.c
@@ -989,6 +989,7 @@ random_real(VALUE obj, rb_random_t *rnd, int excl)
}
else {
const rb_random_interface_t *rng = try_rand_if(obj, rnd);
+ if (rng->get_real) return rng->get_real(rnd, excl);
a = random_int32(rng, rnd);
b = random_int32(rng, rnd);
}