@@ -1189,9 +1189,8 @@ private double executeRecursiveLogNode(Object value, Object base) {
11891189
11901190 private static double logBigInteger (BigInteger val ) {
11911191 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 ());
11951194 return blex > 0 ? res + blex * LOG2 : res ;
11961195 }
11971196
@@ -1212,7 +1211,7 @@ private double countBase(BigInteger base, ConditionProfile divByZero) {
12121211 }
12131212
12141213 @ Specialization
1215- public double log (long value , @ SuppressWarnings ( "unused" ) PNone novalue ,
1214+ public double log (long value , PNone novalue ,
12161215 @ Cached ("createBinaryProfile()" ) ConditionProfile doNotFit ) {
12171216 return logDN (value , novalue , doNotFit );
12181217 }
@@ -1316,7 +1315,7 @@ public double logPIPI(PInt value, PInt base,
13161315 }
13171316
13181317 @ Specialization (guards = "!isNumber(value)" )
1319- public double logO (Object value , @ SuppressWarnings ( "unused" ) PNone novalue ,
1318+ public double logO (Object value , PNone novalue ,
13201319 @ Cached ("createBinaryProfile()" ) ConditionProfile notNumber ) {
13211320 Object result = getRealNumber (value , getValueDispatchNode (), notNumber );
13221321 return executeRecursiveLogNode (result , novalue );
@@ -1359,7 +1358,7 @@ private void raiseMathError(ConditionProfile doNotFit, boolean con) {
13591358
13601359 private Object getRealNumber (Object object , LookupAndCallUnaryNode dispatchNode , ConditionProfile isNotRealNumber ) {
13611360 Object result = dispatchNode .executeObject (object );
1362- if (result == PNone .NO_VALUE ) {
1361+ if (isNotRealNumber . profile ( result == PNone .NO_VALUE ) ) {
13631362 throw raise (TypeError , "must be real number, not %p" , object );
13641363 }
13651364 return result ;
0 commit comments