Click here to make these examples interactive with ClojureScript.
same.platform
Platform-specific code, to try to minimise reader conditionals in the rest of the codebase.
bit-diff-double
(bit-diff-double f1 f2)
Difference between two doubles in ULPs (i.e. number of representable numbers between them + 1).
bit-diff-float
(bit-diff-float f1 f2)
Difference between two floats in ULPs (i.e. number of representable numbers between them + 1).
sign
(sign f)
Return the sign of f
(+1 if positive, -1 if negative, 0 if zero or NaN if NaN).
ulp
(ulp f)
Units in the Last Place (ULP) of f
(difference between f and the next largest representable number).