diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-04-15 00:45:38 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-09-07 20:08:01 +0900 |
commit | c449b9b02f63cf8268a0eb9639a43caf4598996d (patch) | |
tree | 6765aba80338204e06f753fdf1c039b9f3691d25 /random.c | |
parent | af5e87ab218c5f4e34c6cdb54ae119a7f0f9033f (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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); } |