aboutsummaryrefslogtreecommitdiffstats
path: root/random.c
diff options
context:
space:
mode:
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 616cd68b52..1a93779dc9 100644
--- a/random.c
+++ b/random.c
@@ -1168,8 +1168,8 @@ rand_random(int argc, VALUE *argv, rb_random_t *rnd)
if (argc == 0) {
return rb_float_new(genrand_real(&rnd->mt));
}
- else if (argc != 1) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0..1)", argc);
+ else {
+ rb_check_arity(argc, 0, 1);
}
vmax = argv[0];
if (NIL_P(vmax)) {