diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-11 22:33:01 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-11 22:33:01 +0000 |
commit | e39523b77b6d27a59950c741b46f0b7c8bb5539a (patch) | |
tree | 3cdd997b26ed586698f7f0fe3ab78a16233511b8 /random.c | |
parent | 28d975a6330c6111a99f5f7530f0a56709a98a50 (diff) | |
download | ruby-e39523b77b6d27a59950c741b46f0b7c8bb5539a.tar.gz |
* random.c (rand_int): Use rb_big_uminus.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r-- | random.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -946,8 +946,7 @@ rand_int(struct MT *mt, VALUE vmax, int restrictive) if (rb_bigzero_p(vmax)) return Qnil; if (!RBIGNUM_SIGN(vmax)) { if (restrictive) return Qnil; - vmax = rb_big_clone(vmax); - RBIGNUM_SET_SIGN(vmax, 1); + vmax = rb_big_uminus(vmax); } vmax = rb_big_minus(vmax, INT2FIX(1)); if (FIXNUM_P(vmax)) { |