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,
>
> Also, you can use java.lang.Math/nextUp and nextAfter to get adjacent
> doubles for your bounds.
>
> (java.lang.Math/
> (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)
I should have mentioned that Double/MIN_VALUE is the smallest positive double
(just greater than 0.0), not a large negative value. It’s easy to get confused
On Thursday, July 21, 2016 at 9:51:02 AM UTC-5, Alex Miller wrote:
>
> You can already get open intervals by just omitting :min or :max.
>
I think my terminology may have created some confusion; I probably
shouldn't have used open/closed. I meant "open interval" in the sense that
an open interv
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
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 a
On Wednesday, July 20, 2016 at 10:02:17 PM UTC-5, Alex Miller wrote:
>
> On Wednesday, July 20, 2016 at 9:41:59 PM UTC-5, Mars0i wrote:
>>
>> On Wednesday, July 20, 2016 at 4:32:40 PM UTC-5, Alex Miller wrote:
>>>
>>> You can file a jira if you like, I'm not sure Rich's thoughts on this.
>>>
>>
On Wednesday, July 20, 2016 at 9:41:59 PM UTC-5, Mars0i wrote:
>
> On Wednesday, July 20, 2016 at 4:32:40 PM UTC-5, Alex Miller wrote:
>>
>> You can file a jira if you like, I'm not sure Rich's thoughts on this.
>>
>
> I understand. Thanks--will do.
>
>
>> Also, keep in mind that you can also
On Wednesday, July 20, 2016 at 4:32:40 PM UTC-5, Alex Miller wrote:
>
> You can file a jira if you like, I'm not sure Rich's thoughts on this.
>
I understand. Thanks--will do.
> Also, keep in mind that you can also compose preds and get this with
> slightly more effort now:
>
> (s/and (s/dou
You can file a jira if you like, I'm not sure Rich's thoughts on this.
Also, keep in mind that you can also compose preds and get this with
slightly more effort now:
(s/and (s/double-in :min 0.0 :max 1.0) #(not= 0.0 %))
On Wednesday, July 20, 2016 at 2:03:28 PM UTC-5, Mars0i wrote:
>
> cloj
clojure.spec/double-in defines a spec that tests whether a double is
greater than or equal to a minimum value and less than or equal to a
maximum value. This is useful for many purposes, but sometimes you need to
test whether a double is greater than a minimum or less than a maximum.
There ar
10 matches
Mail list logo