Method: Complex#to_f
- Defined in:
- complex.c
#to_f ⇒ Float
1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 |
# File 'complex.c', line 1615
static VALUE
nucomp_to_f(VALUE self)
{
get_dat1(self);
if (!k_exact_zero_p(dat->imag)) {
rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Float",
self);
}
return f_to_f(dat->real);
}
|