Module: Random::Formatter

Included in:
Random
Defined in:
random.c

Instance Method Summary collapse

Instance Method Details

#random_number(*args) ⇒ Object



1318
1319
1320
1321
1322
1323
1324
1325
1326
# File 'random.c', line 1318

static VALUE
rand_random_number(int argc, VALUE *argv, VALUE obj)
{
    rb_random_t *rnd = try_get_rnd(obj);
    VALUE v = rand_random(argc, argv, obj, rnd);
    if (NIL_P(v)) v = rand_random(0, 0, obj, rnd);
    else if (!v) invalid_argument(argv[0]);
    return v;
}