The Compare Floating Point operator compares floating point numbers using "visual" precision, i.e., numbers that display as the same string are considered equal. This is one way of dealing with floating point rounding issues that can cause apparently correct results to be marked as incorrect.
match value | major version |
3 | abandon story test |
6 | abandon story test |
7 | abandon story test |
when input is | 'sample do'
check 'divide float' 1 '' 3 0.3333333
check 'divide double' 1 '' 3 0.333333333333333
configure processor 'add operator' CompareFloatingPoint
'sample do'
check 'divide float' 1 '' 3 0.3333333
check 'divide double' 1 '' 3 0.333333333333333 | then output is | check | divide float | 1 | | 3 | 0.3333333 expected 0.3333333 actual |
check | divide double | 1 | | 3 | 0.333333333333333 expected 0.333333333333333 actual |
configure | processor | add operator | CompareFloatingPoint |
check | divide float | 1 | | 3 | 0.3333333 |
check | divide double | 1 | | 3 | 0.333333333333333 |
|