MCPcopy Create free account
hub / github.com/antlr/codebuff / isPowerOfTwo

Method isPowerOfTwo

output/java_guava/1.4.19/DoubleMath.java:193–196  ·  view source on GitHub ↗

Returns true if x is exactly equal to 2^k for some finite integer k.

(double x)

Source from the content-addressed store, hash-verified

191 */
192
193 @GwtIncompatible // com.google.common.math.DoubleUtils
194 public static boolean isPowerOfTwo(double x) {
195 return x > 0.0 && isFinite(x) && LongMath.isPowerOfTwo(getSignificand(x));
196 }
197
198 /**
199 * Returns the base 2 logarithm of a double value.

Callers 1

log2Method · 0.95

Calls 3

isPowerOfTwoMethod · 0.95
isFiniteMethod · 0.45
getSignificandMethod · 0.45

Tested by

no test coverage detected