your def : s is BigDecimals
groovy:000> p1 = 0.1 ===> 0.1 groovy:000> p1.getClass() ===> class java.math.BigDecimal
And equals not suitable for comparing between BigDecimal and native float / double
groovy:000> p1.equals(0.1f) ===> false groovy:000> p1.equals(0.1) ===> true groovy:000> p1==0.1f ===> false groovy:000> p1==0.1 ===> true
Not sure why == works for [Dd] ouble.
groovy:000> p1.equals(0.1d) ===> false groovy:000> p1==0.1d ===> true
My guess would be that it stalled in DefaultTypeTransformation.compareToWithEqualityCheck . Since both sides: Number: s.
source share