nextafter

emlib.calculus.nextafter(x, direction=1)[source]

returns the next float after x in the direction indicated

if not possible, returns x

Parameters:
  • x (float) – the value to evaluate

  • direction – if 1, the next float is searched upwards, otherwise downwards

Return type:

float

Returns:

a next representable float from x in the direction indicated