summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-10 05:44:54 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-10 05:44:54 +0000
commit493f72185499f3fea1212b04d177a0870d6e89c3 (patch)
tree56880f8983a8db79d2e5c080bfd600cf29d63b61 /bignum.c
parent7c73db266ac8632905438fba5cd9d6216ce4084c (diff)
* random.c (rb_genrand_ulong_limited): renamed from
rb_rand_internal and now this is public API. * include/ruby/ruby.h (rb_genrand_ulong_limited): added. * bignum.c (big_sparse_p): use rb_genrand_ulong_limited. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bignum.c b/bignum.c
index 1dd43df494..3145f24843 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2214,11 +2214,10 @@ static inline VALUE
big_sparse_p(VALUE x)
{
long c = 0, n = RBIGNUM_LEN(x);
- unsigned long rb_rand_internal(unsigned long i);
- if ( BDIGITS(x)[rb_rand_internal(n / 2) + n / 4]) c++;
- if (c <= 1 && BDIGITS(x)[rb_rand_internal(n / 2) + n / 4]) c++;
- if (c <= 1 && BDIGITS(x)[rb_rand_internal(n / 2) + n / 4]) c++;
+ if ( BDIGITS(x)[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
+ if (c <= 1 && BDIGITS(x)[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
+ if (c <= 1 && BDIGITS(x)[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
return (c <= 1) ? Qtrue : Qfalse;
}