Skip to content

Commit 3aa9442

Browse files
committed
Wrap Double infinities in const
1 parent ddec639 commit 3aa9442

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/org/scalacheck/Gen.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,10 @@ object Gen extends GenArities{
411411
def choose(low: Double, high: Double) =
412412
if (low > high) throw new IllegalBoundsError(low, high)
413413
else if (low == Double.NegativeInfinity)
414-
frequency(1 -> Double.NegativeInfinity,
414+
frequency(1 -> const(Double.NegativeInfinity),
415415
9 -> choose(Double.MinValue, high))
416416
else if (high == Double.PositiveInfinity)
417-
frequency(1 -> Double.PositiveInfinity,
417+
frequency(1 -> const(Double.PositiveInfinity),
418418
9 -> choose(low, Double.MaxValue))
419419
else gen(chDbl(low,high))
420420
}

0 commit comments

Comments
 (0)