@JRubyMethod(name = "**", required = 1) public IRubyObject op_pow19(ThreadContext context, IRubyObject other) { double d_other = ((RubyNumeric) other).getDoubleValue(); if (value < 0 && (d_other != Math.round(d_other))) { return RubyComplex.newComplexRaw(getRuntime(), this).callMethod(context, "**", other); } else { return op_pow(context, other); } }
/** num_imaginary */ @JRubyMethod(name = "i") public IRubyObject num_imaginary(ThreadContext context) { return RubyComplex.newComplexRaw(context.runtime, RubyFixnum.zero(context.runtime), this); }
/** numeric_to_c */ @JRubyMethod(name = "to_c") public IRubyObject to_c(ThreadContext context) { return RubyComplex.newComplexCanonicalize(context, this); }