(double d)
| 207 | } |
| 208 | |
| 209 | public static double nextDown(double d) { |
| 210 | if (Double.isNaN(d)) { |
| 211 | return d; |
| 212 | } |
| 213 | if (d == Double.NEGATIVE_INFINITY) { |
| 214 | return d; |
| 215 | } |
| 216 | long bits = Double.doubleToLongBits(d); |
| 217 | boolean negative = (bits & (1L << 63)) != 0; |
| 218 | if (negative) { |
| 219 | bits++; |
| 220 | } else { |
| 221 | bits--; |
| 222 | } |
| 223 | return Double.longBitsToDouble(bits); |
| 224 | } |
| 225 | |
| 226 | |
| 227 | public static double nextAfter(double start, double direction) { |
no test coverage detected