aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bignum.c b/bignum.c
index 0e15e58c12..8c723300f4 100644
--- a/bignum.c
+++ b/bignum.c
@@ -3184,13 +3184,15 @@ rb_int2big(SIGNED_VALUE n)
VALUE
rb_uint2inum(VALUE n)
{
- return ULONG2NUM(n);
+ if (POSFIXABLE(n)) return LONG2FIX(n);
+ return rb_uint2big(n);
}
VALUE
rb_int2inum(SIGNED_VALUE n)
{
- return LONG2NUM(n);
+ if (FIXABLE(n)) return LONG2FIX(n);
+ return rb_int2big(n);
}
void