ClojureDocs

Nav

Namespaces

next-after

clojure.math

Available since 1.11
  • (next-after start direction)
Returns the adjacent floating point number to start in the direction of
the second argument. If the arguments are equal, the second is returned.
If either arg is #NaN => #NaN
If both arguments are signed zeros => direction
If start is +-Double/MIN_VALUE and direction would cause a smaller magnitude
  => zero with sign matching start
If start is ##Inf or ##-Inf and direction would cause a smaller magnitude
  => Double/MAX_VALUE with same sign as start
If start is equal to +=Double/MAX_VALUE and direction would cause a larger magnitude
  => ##Inf or ##-Inf with sign matching start
See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#nextAfter-double-double-