Skip to content

Commit 84f101b

Browse files
committedMar 2, 2018
useful to override op_uminus in Rational impl
1 parent fab5e25 commit 84f101b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

Diff for: ‎core/src/main/java/org/jruby/RubyRational.java

+5
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,11 @@ public final RubyNumeric op_minus(ThreadContext context, RubyRational other) {
555555
@Deprecated
556556
public IRubyObject op_sub(ThreadContext context, IRubyObject other) { return op_minus(context, other); }
557557

558+
@Override
559+
public IRubyObject op_uminus(ThreadContext context) {
560+
return RubyRational.newRationalNoReduce(context, num.negate(), den);
561+
}
562+
558563
/** f_muldiv
559564
*
560565
*/

0 commit comments

Comments
 (0)
Please sign in to comment.