You can already get open intervals by just omitting :min or :max. On Thursday, July 21, 2016 at 8:50:21 AM UTC-5, miner wrote: > > With a little help from Java, you can make equivalent open intervals for > the desired bounds. For example, > > (s/and (s/double-in :min 0.0 :max 1.0) #(not= 0.0 %)) > > should be the same as > > (s/double-in :min Double/MIN_VALUE :max 1.0) > > Also, you can use java.lang.Math/nextUp and nextAfter to get adjacent > doubles for your bounds. > > (java.lang.Math/nextUp 1.1) > ;=> 1.1000000000000003 > > (java.lang.Math/nextAfter 1.1 Double/NEGATIVE_INFINITY) > ;=> 1.0999999999999999 > > There are a few tricky situations around the zeroes and infinities so you > should read the doc on nextAfter, especially if you’re dealing with extreme > doubles. > >
-- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.