Method: Float#angle

Defined in:
complex.c

#arg0, Float #angle0, Float #phase0, Float

Returns 0 if the value is positive, pi otherwise.

Overloads:


2278
2279
2280
2281
2282
2283
2284
2285
2286
# File 'complex.c', line 2278

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);
}