APIdock / Ruby
/
method

phase

ruby latest stable - Class: Numeric
phase()
public

Returns 0 if the value is positive, pi otherwise.

static VALUE
numeric_arg(VALUE self)
{
 if (f_positive_p(self))
 return INT2FIX(0);
 return DBL2NUM(M_PI);
}

AltStyle によって変換されたページ (->オリジナル) /