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

Method isMathematicalInteger

output/java_guava/1.4.19/DoubleMath.java:279–284  ·  view source on GitHub ↗

Returns true if x represents a mathematical integer. This is equivalent to, but not necessarily implemented as, the expression !Double.isNaN(x) && !Double.isInfinite(x) && x == Math.rint(x).

(double x)

Source from the content-addressed store, hash-verified

277 */
278
279 @GwtIncompatible // java.lang.Math.getExponent, com.google.common.math.DoubleUtils
280 public static boolean isMathematicalInteger(double x) {
281 return isFinite(x)
282 && (x == 0.0
283 || SIGNIFICAND_BITS - Long.numberOfTrailingZeros(getSignificand(x)) <= getExponent(x));
284 }
285
286 /**
287 * Returns {@code n!}, that is, the product of the first {@code n} positive integers, {@code 1} if

Callers 1

roundIntermediateMethod · 0.95

Calls 2

isFiniteMethod · 0.45
getSignificandMethod · 0.45

Tested by

no test coverage detected