Skip to content

Commit

Permalink
useful to override op_uminus in Rational impl
Browse files Browse the repository at this point in the history
kares committed Mar 2, 2018

Verified

This commit was signed with the committer’s verified signature.
headius Charles Oliver Nutter
1 parent fab5e25 commit 84f101b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/RubyRational.java
Original file line number Diff line number Diff line change
@@ -555,6 +555,11 @@ public final RubyNumeric op_minus(ThreadContext context, RubyRational other) {
@Deprecated
public IRubyObject op_sub(ThreadContext context, IRubyObject other) { return op_minus(context, other); }

@Override
public IRubyObject op_uminus(ThreadContext context) {
return RubyRational.newRationalNoReduce(context, num.negate(), den);
}

/** f_muldiv
*
*/

0 comments on commit 84f101b

Please sign in to comment.