instance method
Float#arg
() -> (::Integer | ::Float)
arg → 0 or Math::PI
complex.c
View on GitHub ↗
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);
}
Returns 0 if self is positive, Math::PI otherwise.