summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2021-09-11 09:56:59 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-12 11:16:31 +0900
commit83a5e2bb5c1b9f24b70dc30c50b5deb4d7232119 (patch)
tree4b1746f42c5806022b299ecef9f3f6d833fcf442 /random.c
parentaf5826a25e24ba7179038f99362aa918d48bd8be (diff)
Using RB_FLOAT_TYPE_P macro
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4821
Diffstat (limited to 'random.c')
-rw-r--r--random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/random.c b/random.c
index 232fe3e6f5..eff8b27acd 100644
--- a/random.c
+++ b/random.c
@@ -1363,7 +1363,7 @@ rand_range(VALUE obj, rb_random_t* rnd, VALUE range)
if ((v = vmax = range_values(range, &beg, &end, &excl)) == Qfalse)
return Qfalse;
if (NIL_P(v)) domain_error();
- if (!RB_TYPE_P(vmax, T_FLOAT) && (v = rb_check_to_int(vmax), !NIL_P(v))) {
+ if (!RB_FLOAT_TYPE_P(vmax) && (v = rb_check_to_int(vmax), !NIL_P(v))) {
long max;
vmax = v;
v = Qnil;
@@ -1480,7 +1480,7 @@ rand_random(int argc, VALUE *argv, VALUE obj, rb_random_t *rnd)
}
vmax = argv[0];
if (NIL_P(vmax)) return Qnil;
- if (!RB_TYPE_P(vmax, T_FLOAT)) {
+ if (!RB_FLOAT_TYPE_P(vmax)) {
v = rb_check_to_int(vmax);
if (!NIL_P(v)) return rand_int(obj, rnd, v, 1);
}