Skip to content

Commit

Permalink
[Truffle] Adding Complex specialization for Fixnum#/.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed Apr 5, 2015
1 parent 0a50771 commit 76ab98b
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -582,6 +582,16 @@ public Object div(VirtualFrame frame, int a, RubyBasicObject b) {
return rationalDivNode.call(frame, aRational, "/", null, b);
}

@Specialization(guards = "isComplex(arguments[1])")
public Object divComplex(VirtualFrame frame, int a, RubyBasicObject b) {
return ruby(frame, "Complex(a) / b", "a", a, "b", b);
}

@Specialization(guards = "isComplex(arguments[1])")
public Object divComplex(VirtualFrame frame, long a, RubyBasicObject b) {
return ruby(frame, "Complex(a) / b", "a", a, "b", b);
}

}

@CoreMethod(names = "%", required = 1)
Expand Down

0 comments on commit 76ab98b

Please sign in to comment.