| InvalidOperationException | either x or y is signaling NaN |
| OverflowException | result is ±∞ |
| UnderflowException | result is subnormal or ±0.0 |
| InexactException | result is ±∞, subnormal or ±0.0 |
| x | y | nextAfter(x, y) |
|---|---|---|
| NaN | any | NaN |
| any | NaN | NaN |
| x = y | x | |
| x < y | nextUp(x) | |
| x > y | nextDown(x) |
Returns the next value after or before x, toward y.