Skip to content

DoubleDomain

class in io.proptastic

class DoubleDomain

doubles, all of them unless bounded: doubles().atLeast(0).lessThan(1). A try draws a whole number first, then one with a short fraction, then anything in range: so a counterexample shrinks to the plainest number that still fails, 0.0 if it can.

Unbounded, it also draws NaN, the two infinities, -0.0 and the smallest subnormal, one try in 16 among them, where comparisons, Math.max, sorting, equals and division break; .finite() or any bound leaves them out. One is drawn in place of a number drawn first, so a failure that number shares shrinks to it: a special is always more choices than the number beside it.

Methods

finite

DoubleDomain finite()

Finite numbers only: no NaN and no infinities. A bounded range is always finite.

Privacy