cpp/numeric/math/nextafter

Returns the next representable value of in the direction of.

@1-3@ If equals,  is returned. @4-6@ If equals,  is returned, converted from  to the return type of the function without loss of range or precision.

@A@ Additional overloads are provided for all other combinations of arithmetic types. @B@ Additional overloads are provided for all integer types, which are treated as.

Return value
If no errors occur, the next representable value of in the direction of. is returned. If equals, then  is returned.

If a range error due to overflow occurs, huge_val,, or is returned (with the same sign as ).

If a range error occurs due to underflow, the correct result is returned.

Error handling
Errors are reported as specified in math_errhandling.

If the implementation supports IEEE floating-point arithmetic (IEC 60559),
 * if is finite, but the expected result is an infinity, raises fe_inexact and fe_overflow
 * if does not equal  and the result is subnormal or zero, raises fe_inexact and fe_underflow
 * in any case, the returned value is independent of the current rounding mode
 * if either or  is NaN, NaN is returned