cljs.spec.alpha/double-in
(double-in & {:keys [infinite? NaN? min max], :or {infinite? true, NaN? true}, :as m})
Source docstring:
Specs a 64-bit floating point number. Options:
:infinite? - whether +/- infinity allowed (default true)
:NaN? - whether NaN allowed (default true)
:min - minimum value (inclusive, default none)
:max - maximum value (inclusive, default none)
(defmacro double-in
[& {:keys [infinite? NaN? min max]
:or {infinite? true NaN? true}
:as m}]
`(spec (and c/double?
~@(when-not infinite? '[#(not (infinite? %))])
~@(when-not NaN? '[#(not (js/isNaN %))])
~@(when max `[#(<= % ~max)])
~@(when min `[#(<= ~min %)]))
:gen #(gen/double* ~m)))