ClojureDocs

Nav

Namespaces

Take the 2026 State of Clojure Survey! Help shape the future of Clojure — open through Nov 30. Take Survey →
core.async
core.logic
data.csv
spec.alpha
tools.build
  • clojure
tools.deps

next-after

clojure.math

Available since 1.11 (source)
  • (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-