public static float nextAfter (float start, double direction)

Returns the floating-point number adjacent to the first argument in the direction of the second argument. If both arguments compare as equal a value equivalent to the second argument is returned.

Special cases:

- If either argument is a NaN, then NaN is returned.
- If both arguments are signed zeros, a value equivalent
to
`direction`

is returned. - If
`start`

is ±`Float.MIN_VALUE`

and`direction`

has a value such that the result should have a smaller magnitude, then a zero with the same sign as`start`

is returned. - If
`start`

is infinite and`direction`

has a value such that the result should have a smaller magnitude,`Float.MAX_VALUE`

with the same sign as`start`

is returned. - If
`start`

is equal to ±`Float.MAX_VALUE`

and`direction`

has a value such that the result should have a larger magnitude, an infinity with same sign as`start`

is returned.

`start` | starting floating-point value | |

`direction` | value indicating which of
` start` 's neighbors or ` start` should
be returned |

` start`

in the
direction of ` direction`

.

Diagram: Math