comparisons with zero are absoloute (epsilon method)
comparisons with non-zeros are relative (bit pattern distance method)
I also renamed TOLERANCE to conform with Go conventions
performance difference (slower as expected)
name old time/op new time/op delta
CmpFloat-4 4.89ms ± 1% 5.53ms ± 1% +12.93% (p=0.000 n=8+7)
name old alloc/op new alloc/op delta
CmpFloat-4 66.7B ± 1% 75.1B ± 1% +12.63% (p=0.001 n=7+7)
name old allocs/op new allocs/op delta
CmpFloat-4 0.00 0.00 ~ (all equal)
I also renamed
TOLERANCE
to conform with Go conventionsperformance difference (slower as expected)