File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -872,19 +872,24 @@ public double sin(double value) {
872
872
}
873
873
}
874
874
875
- @ Builtin (name = "log" , fixedNumOfArguments = 1 )
875
+ @ Builtin (name = "log" , minNumOfArguments = 1 , maxNumOfArguments = 2 )
876
876
@ GenerateNodeFactory
877
877
public abstract static class LogNode extends PythonBuiltinNode {
878
878
879
879
@ Specialization
880
- public double log (int value ) {
880
+ public double log (int value , @ SuppressWarnings ( "unused" ) PNone novalue ) {
881
881
return Math .log (value );
882
882
}
883
883
884
884
@ Specialization
885
- public double log (double value ) {
885
+ public double log (double value , @ SuppressWarnings ( "unused" ) PNone novalue ) {
886
886
return Math .log (value );
887
887
}
888
+
889
+ @ Specialization
890
+ public double log (int value , int base ) {
891
+ return Math .log (value ) / Math .log (base );
892
+ }
888
893
}
889
894
890
895
@ Builtin (name = "fabs" , fixedNumOfArguments = 1 )
You can’t perform that action at this time.
0 commit comments