Modified: MacRuby/trunk/random.c (3830 => 3831)
--- MacRuby/trunk/random.c 2010-03-19 22:36:34 UTC (rev 3830)
+++ MacRuby/trunk/random.c 2010-03-19 22:42:44 UTC (rev 3831)
@@ -473,7 +473,11 @@
static VALUE
limited_big_rand(struct MT *mt, struct RBignum *limit)
{
+#if SIZEOF_BDIGITS < 8
const long len = (RBIGNUM_LEN(limit) * SIZEOF_BDIGITS + 3) / 4;
+#else
+ const long len = (RBIGNUM_LEN(limit) * SIZEOF_BDIGITS + 3) / 8;
+#endif
struct RBignum *val = (struct RBignum *)rb_big_clone((VALUE)limit);
RBIGNUM_SET_SIGN(val, 1);
#if SIZEOF_BDIGITS == 2