Using the preset infinity constants is probably the best solution in this case. :)
- James On 11 April 2017 at 01:50, Brian Beckman <[email protected]> wrote: > James -- just the kind of simplification I was looking for! In fact, I > think the following will do everything I need --- generate numbers avoiding > only NaN (which isn't equal to itself, nor less than anything) > > (s/def ::virtual-time > (s/with-gen > (s/and > number? #(not (Double/isNaN %))) > ;; We'd like most values generated in tests to be finite, with the > ;; occasional infinity for spice. Adjust these frequencies to taste. > #(gen/frequency [[98 (s/gen number?)] > [ 1 (gen/return Double/NEGATIVE_INFINITY)] > [ 1 (gen/return Double/POSITIVE_INFINITY)]]))) > > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected] > 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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
