diff options
author | S-H-GAMELINKS <[email protected]> | 2021-09-11 09:56:59 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-09-12 11:16:31 +0900 |
commit | 83a5e2bb5c1b9f24b70dc30c50b5deb4d7232119 (patch) | |
tree | 4b1746f42c5806022b299ecef9f3f6d833fcf442 /random.c | |
parent | af5826a25e24ba7179038f99362aa918d48bd8be (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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } |