Returns the long value that is equal to x rounded with the specified rounding mode, if possible. @throws ArithmeticException if x is infinite or NaN x, after being rounded to a mathematical integer using the specified rounding mode, i
(double x, RoundingMode mode)
| 147 | */ |
| 148 | |
| 149 | @GwtIncompatible // #roundIntermediate |
| 150 | public static long roundToLong(double x, RoundingMode mode) { |
| 151 | double z = roundIntermediate(x, mode); |
| 152 | checkInRange(MIN_LONG_AS_DOUBLE - z < 1.0 & z < MAX_LONG_AS_DOUBLE_PLUS_ONE); |
| 153 | return (long) z; |
| 154 | } |
| 155 | |
| 156 | private static final double MIN_LONG_AS_DOUBLE = -0x1p63; |
| 157 | /* |
nothing calls this directly
no test coverage detected