Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
BigDecimals carry both a numerical value and a precision (scale).
In Groovy, when BigDecimals are compared, only the numerical value is taken into account, but isCase() uses both value and scale.
This should be consistent.
assert 0.5 == 0.50000 // works
switch(0.5) {
case 0.50000: println "match" // doesn't match
}