def next_after(x, y):
    if math.isnan(x):
        return x
if math.isnan(y):
    return y
if y == x:
    return y
elif y > x:
    return next_up(x)
else:
    return next_down(x)
How do you get the next value in the floating-point sequence?