if (a2 instanceof RubyComplex) {
RubyComplex a2Complex = (RubyComplex)a2;
if (k_exact_p(a2Complex.getImage()) && f_zero_p(context, a2Complex.getImage())) a2 = a2Complex.getReal();
}
Frame frame = context.getCurrentFrame();
IRubyObject backref = frame.getBackRef();
if (backref != null && backref instanceof RubyMatchData) ((RubyMatchData)backref).use();
if (a1 instanceof RubyFloat) {
a1 = f_to_r(context, a1);
} else if (a1 instanceof RubyString) {
a1 = str_to_r_strict(context, a1);
}
if (a2 instanceof RubyFloat) {
a2 = f_to_r(context, a2);
} else if (a2 instanceof RubyString) {
a2 = str_to_r_strict(context, a2);
}
frame.setBackRef(backref);
if (a1 instanceof RubyRational) {
if (a2.isNil() || (k_exact_p(a2) && f_one_p(context, a2))) return a1;
}