Skip to content

Commit eb6e0ed

Browse files
committed
add missing specialization for reverse div with native floats
1 parent df75f35 commit eb6e0ed

File tree

1 file changed

+11
-0
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/floats

1 file changed

+11
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/floats/FloatBuiltins.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,17 @@ abstract static class RDivNode extends PythonBinaryBuiltinNode {
797797
return left.doubleValue() / right;
798798
}
799799

800+
@Specialization
801+
Object doDP(PythonNativeObject right, long left,
802+
@Cached("nativeFloat()") FromNativeSubclassNode<Double> getFloat) {
803+
Double rPrimitive = getFloat.execute(right);
804+
if (rPrimitive != null) {
805+
return left / rPrimitive;
806+
} else {
807+
return PNotImplemented.NOT_IMPLEMENTED;
808+
}
809+
}
810+
800811
@SuppressWarnings("unused")
801812
@Fallback
802813
PNotImplemented doGeneric(Object right, Object left) {

0 commit comments

Comments
 (0)