Method: Complex#rationalize
- Defined in:
- complex.c
permalink #rationalize([eps]) ⇒ Object
1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 |
# File 'complex.c', line 1665
static VALUE
nucomp_rationalize(int argc, VALUE *argv, VALUE self)
{
get_dat1(self);
rb_check_arity(argc, 0, 1);
if (!k_exact_zero_p(dat->imag)) {
rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
self);
}
return rb_funcallv(dat->real, id_rationalize, argc, argv);
}
|