Fork me on GitHub

There is an example spec using s/double-in on the spec guide page: (s/def ::dubs (s/double-in :min -100.0 :max 100.0 :NaN? false :infinite? false)) I have tried changing the false occurrences to true, and leaving out the :NaN? and :infinite? keys, but I always see (s/valid? ::dubs ##Inf) evaluate to false, as well as (s/valid? ::dubs ##-Inf) and (s/valid? ::dubs ##NaN). Is that expected?


I guess it makes sense for ##-Inf to be invalid if a :min value is specified that is a double value other than ##-Inf, and similarly for :max values and ##Inf.


But it seems like specifying either :min or :max changes the validity of ##NaN from true to false.


no matter what the value associated with the :NaN? key happens to be

Alex Miller (Clojure team)02:06:40

might be the ordering of the checks

Alex Miller (Clojure team)02:06:14

if you (s/form :;dubs) you can see what it expands to

Alex Miller (Clojure team)03:06:52

maybe buggy at a glance as it's an s/and and it starts flowing the boolean rather than the double


I doubt that is a hot ticket item for anyone, but created a JIRA ticket as a reminder: