aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c34
1 files changed, 4 insertions, 30 deletions
diff --git a/numeric.c b/numeric.c
index 480ab7e..739c968 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2879,14 +2879,6 @@ rb_out_of_int(SIGNED_VALUE num)
}
static void
-check_int(long num)
-{
- if ((long)(int)num != num) {
- rb_out_of_int(num);
- }
-}
-
-static void
check_uint(unsigned long num, int sign)
{
if (sign) {
@@ -2901,24 +2893,6 @@ check_uint(unsigned long num, int sign)
}
}
-long
-rb_num2int(VALUE val)
-{
- long num = rb_num2long(val);
-
- check_int(num);
- return num;
-}
-
-long
-rb_fix2int(VALUE val)
-{
- long num = FIXNUM_P(val)?FIX2LONG(val):rb_num2long(val);
-
- check_int(num);
- return num;
-}
-
unsigned long
rb_num2uint(VALUE val)
{
@@ -2942,19 +2916,19 @@ rb_fix2uint(VALUE val)
check_uint(num, negative_int_p(val));
return num;
}
-#else
+#endif
+
long
rb_num2int(VALUE val)
{
- return rb_num2long(val);
+ return NUM2INT(val);
}
long
rb_fix2int(VALUE val)
{
- return FIX2INT(val);
+ return FIX2INT(val)
}
-#endif
NORETURN(static void rb_out_of_short(SIGNED_VALUE num));
static void