Project

General

Profile

Bug #12485 ยป rational.c.diff

mrkn (Kenta Murata), 06/13/2016 02:53 PM

View differences:

rational.c
476 476
}
477 477
#endif
478 478

  
479
inline static void
479
inline static VALUE
480 480
nurat_int_check(VALUE num)
481 481
{
482
    if (!(RB_TYPE_P(num, T_FIXNUM) || RB_TYPE_P(num, T_BIGNUM))) {
483
	if (!k_numeric_p(num) || !f_integer_p(num))
484
	    rb_raise(rb_eTypeError, "not an integer");
485
    }
482
    if (RB_TYPE_P(num, T_FIXNUM) || RB_TYPE_P(num, T_BIGNUM))
483
	return num;
484
    return rb_to_int(num);
486 485
}
487 486

  
488 487
inline static VALUE