We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
choose
1 parent 419a639 commit 12437a0Copy full SHA for 12437a0
test/scalacheck/duration.scala
@@ -32,7 +32,10 @@ object DurationTest extends Properties("Division of Duration by Long") {
32
val genClose = for {
33
a <- weightedLong
34
if a != 0
35
- b <- choose(Long.MaxValue / a - 10, Long.MaxValue / a + 10)
+ val center = Long.MaxValue / a
36
+ b <-
37
+ if (center - 10 < center + 10) choose(center - 10, center + 10)
38
+ else choose(center + 10, center - 10) // deal with overflow if abs(a) == 1
39
} yield (a, b)
40
41
val genBorderline =
0 commit comments