@@ -1158,31 +1158,31 @@ public abstract static class LogNode extends PythonUnaryBuiltinNode {
1158
1158
@ Child private LookupAndCallUnaryNode valueDispatchNode ;
1159
1159
@ Child private LookupAndCallUnaryNode baseDispatchNode ;
1160
1160
@ Child private LogNode recLogNode ;
1161
-
1161
+
1162
1162
private LookupAndCallUnaryNode getValueDispatchNode () {
1163
1163
if (valueDispatchNode == null ) {
1164
1164
CompilerDirectives .transferToInterpreterAndInvalidate ();
1165
1165
valueDispatchNode = insert (LookupAndCallUnaryNode .create (SpecialMethodNames .__FLOAT__ ));
1166
1166
}
1167
1167
return valueDispatchNode ;
1168
1168
}
1169
-
1169
+
1170
1170
private LookupAndCallUnaryNode getBaseDispatchNode () {
1171
1171
if (baseDispatchNode == null ) {
1172
1172
CompilerDirectives .transferToInterpreterAndInvalidate ();
1173
1173
baseDispatchNode = insert (LookupAndCallUnaryNode .create (SpecialMethodNames .__FLOAT__ ));
1174
1174
}
1175
1175
return baseDispatchNode ;
1176
1176
}
1177
-
1177
+
1178
1178
private double executeRecursiveLogNode (Object value , Object base ) {
1179
1179
if (recLogNode == null ) {
1180
1180
CompilerDirectives .transferToInterpreterAndInvalidate ();
1181
1181
recLogNode = insert (LogNode .create ());
1182
1182
}
1183
1183
return recLogNode .executeObject (value , base );
1184
1184
}
1185
-
1185
+
1186
1186
public abstract double executeObject (Object value , Object base );
1187
1187
1188
1188
private static final double LOG2 = Math .log (2.0 );
@@ -1210,7 +1210,7 @@ private double countBase(BigInteger base, ConditionProfile divByZero) {
1210
1210
}
1211
1211
return logBase ;
1212
1212
}
1213
-
1213
+
1214
1214
@ Specialization
1215
1215
public double log (long value , @ SuppressWarnings ("unused" ) PNone novalue ,
1216
1216
@ Cached ("createBinaryProfile()" ) ConditionProfile doNotFit ) {
@@ -1345,18 +1345,18 @@ public double logDO(double value, Object base,
1345
1345
}
1346
1346
1347
1347
@ Specialization (guards = {"!isNumber(base)" })
1348
- public double logPIO (PInt value , Object base ,
1348
+ public double logPIO (PInt value , Object base ,
1349
1349
@ Cached ("createBinaryProfile()" ) ConditionProfile notNumberBase ) {
1350
1350
Object resultBase = getRealNumber (base , getBaseDispatchNode (), notNumberBase );
1351
1351
return executeRecursiveLogNode (value , resultBase );
1352
1352
}
1353
-
1353
+
1354
1354
private void raiseMathError (ConditionProfile doNotFit , boolean con ) {
1355
1355
if (doNotFit .profile (con )) {
1356
1356
throw raise (ValueError , "math domain error" );
1357
1357
}
1358
1358
}
1359
-
1359
+
1360
1360
private Object getRealNumber (Object object , LookupAndCallUnaryNode dispatchNode , ConditionProfile isNotRealNumber ) {
1361
1361
Object result = dispatchNode .executeObject (object );
1362
1362
if (result == PNone .NO_VALUE ) {
0 commit comments