Method: Float#angle
- Defined in:
- complex.c
#arg ⇒ 0, Float #angle ⇒ 0, Float #phase ⇒ 0, Float
Returns 0 if the value is positive, pi otherwise.
2265 2266 2267 2268 2269 2270 2271 2272 2273 |
# File 'complex.c', line 2265
static VALUE
float_arg(VALUE self)
{
if (isnan(RFLOAT_VALUE(self)))
return self;
if (f_tpositive_p(self))
return INT2FIX(0);
return rb_const_get(rb_mMath, id_PI);
}
|