List of usage examples for com.google.common.math LongMath checkedPow
@GwtIncompatible("TODO") public static long checkedPow(long b, int k)
From source file:org.apache.asterix.runtime.evaluators.functions.NumericCaretDescriptor.java
@Override protected long evaluateInteger(long lhs, long rhs) throws HyracksDataException { if (rhs > Integer.MAX_VALUE) { throw new ArithmeticException("Exponent cannot be larger than 2^31-1"); }// www .j a v a 2 s. c o m return LongMath.checkedPow(lhs, (int) rhs); }
From source file:com.qubole.quark.planner.AggStarRule.java
String bitSetToString(ImmutableBitSet bits) { long result = 0; for (Integer i : bits) { result += LongMath.checkedPow(2, i); }/*from w ww. j a v a 2 s . c o m*/ return String.valueOf(result); }
From source file:org.spf4j.zel.operators.LongOperators.java
private static Number powLongInt(final Long a, final Number b) { long result;/* ww w . jav a 2 s . c o m*/ try { result = LongMath.checkedPow(a, b.intValue()); } catch (ArithmeticException e) { return BigInteger.valueOf(a).pow(b.intValue()); } return result; }