Handling floating values, miscellaneous coercions.
Handling floating values, miscellaneous coercions.
(b64 f64)
Converts a 64-bit float to a 64-bit integer preserving the bit pattern.
Opposite of from-b64
.
(def bits
(b64 42.24))
;; equals 4631166901565532406
(= 42.24
(from-b64 bits))
Useful for places which can handle integers but not floats.
Converts a 64-bit float to a 64-bit integer preserving the bit pattern. Opposite of [[from-b64]]. ```clojure (def bits (b64 42.24)) ;; equals 4631166901565532406 (= 42.24 (from-b64 bits)) ``` Useful for places which can handle integers but not floats.
(f32 x)
Coerce x
to a 32-bit float (no-op in JS since there no 32-bit floats).
Coerce `x` to a 32-bit float (no-op in JS since there no 32-bit floats).
(from-b32 b32)
Interprets bits from a 32-bit integer as a 32-bit float.
Opposite of b32
.
Interprets bits from a 32-bit integer as a 32-bit float. Opposite of [[b32]].
(from-b64 b64)
Interprets bits from a 64-bits integer as a 64-bit float.
Opposite of b64
.
Interprets bits from a 64-bits integer as a 64-bit float. Opposite of [[b64]].
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close