when using "chained" double generators with jqwik I get a scale error message java.util.concurrent.ExecutionException: net.jqwik.api.JqwikException: Decimal value -1.6099999999999999 cannot be represented with scale 4.
.
Can you provide me with some details on how to set this scale and the meaning of this parameter ?
Here is the generator function I use :
@Provide("close doubles")
Arbitrary<Tuple.Tuple2<Double,Double>> closeDoubles(@ForAll() Double aDouble) {
return Arbitraries.doubles()
.between(aDouble-2.5, aDouble+2.5)
.withSpecialValue(aDouble)
.ofScale(4)
.map(num ->Tuple.of(aDouble,num));
}
It is then combined to form a business object instance.
My ultimate goal is to generate 2 doubles that are "close" to each other (here the distance is 2.5).