@@ -1189,9 +1189,8 @@ private double executeRecursiveLogNode(Object value, Object base) {
1189
1189
1190
1190
private static double logBigInteger (BigInteger val ) {
1191
1191
int blex = val .bitLength () - 1022 ; // any value in 60..1023 is ok
1192
- if (blex > 0 )
1193
- val = val .shiftRight (blex );
1194
- double res = Math .log (val .doubleValue ());
1192
+ BigInteger value = blex > 0 ? val .shiftRight (blex ) : val ;
1193
+ double res = Math .log (value .doubleValue ());
1195
1194
return blex > 0 ? res + blex * LOG2 : res ;
1196
1195
}
1197
1196
@@ -1212,7 +1211,7 @@ private double countBase(BigInteger base, ConditionProfile divByZero) {
1212
1211
}
1213
1212
1214
1213
@ Specialization
1215
- public double log (long value , @ SuppressWarnings ( "unused" ) PNone novalue ,
1214
+ public double log (long value , PNone novalue ,
1216
1215
@ Cached ("createBinaryProfile()" ) ConditionProfile doNotFit ) {
1217
1216
return logDN (value , novalue , doNotFit );
1218
1217
}
@@ -1316,7 +1315,7 @@ public double logPIPI(PInt value, PInt base,
1316
1315
}
1317
1316
1318
1317
@ Specialization (guards = "!isNumber(value)" )
1319
- public double logO (Object value , @ SuppressWarnings ( "unused" ) PNone novalue ,
1318
+ public double logO (Object value , PNone novalue ,
1320
1319
@ Cached ("createBinaryProfile()" ) ConditionProfile notNumber ) {
1321
1320
Object result = getRealNumber (value , getValueDispatchNode (), notNumber );
1322
1321
return executeRecursiveLogNode (result , novalue );
@@ -1359,7 +1358,7 @@ private void raiseMathError(ConditionProfile doNotFit, boolean con) {
1359
1358
1360
1359
private Object getRealNumber (Object object , LookupAndCallUnaryNode dispatchNode , ConditionProfile isNotRealNumber ) {
1361
1360
Object result = dispatchNode .executeObject (object );
1362
- if (result == PNone .NO_VALUE ) {
1361
+ if (isNotRealNumber . profile ( result == PNone .NO_VALUE ) ) {
1363
1362
throw raise (TypeError , "must be real number, not %p" , object );
1364
1363
}
1365
1364
return result ;
0 commit comments