/guava/guava/src/com/google/common/math/DoubleMath.java
private static final int MIN_LONG_AS_DOUBLE = -0x1p63;
private static final double MIN_LONG_AS_DOUBLE = -0x1p63;
public static long roundToLong(double x, RoundingMode mode) { double z = roundIntermediate(x, mode); checkInRangeForRoundingInputs( MIN_LONG_AS_DOUBLE - z < 1.0 & z < MAX_LONG_AS_DOUBLE_PLUS_ONE, x, mode); return (long) z; } <extra_id_0> private static final double MAX_LONG_AS_DOUBLE_PLUS_ONE = 0x1p63; @J2ktIncompatible @GwtIncompatible public static BigInteger roundToBigInteger(double x, RoundingMode mode) { x = roundIntermediate(x, mode); if (MIN_LONG_AS_DOUBLE - x < 1.0 & x < MAX_LONG_AS_DOUBLE_PLUS_ONE) {