protected static BigInteger getRadixPower ( BigInteger radix , int power ) { long key = ( ( ( long ) radix . intValue ( ) ) << 32 ) | power ; BigInteger result = radixPowerMap . get ( key ) ; if ( result == null ) { if ( power == 1 ) { result = radix ; } else if ( ( power & 1 ) == 0 ) { BigInteger halfPower = getRadixPower ( radix , power >> 1 ) ; result = halfPower . multiply ( halfPower ) ; } else { BigInteger halfPower = getRadixPower ( radix , ( power - 1 ) >> 1 ) ; result = halfPower . multiply ( halfPower ) . multiply ( radix ) ; } radixPowerMap . put ( key , result ) ; } return result ; }
Caches the results of radix to the given power .