In few words, one measure is equal to another when their internal collaborators are equals between each other. And the hash of two measures are equals when the hash of their collaborators are equals too.
"#="
(1/2) = 0.5 "this evaluate to true"
(1/2) ~= 0.5 "this evaluate to false"
"#hash"
(1/2) hash = 0.5 hash "this evaluate to true"
(1/2) hash ~= 0.5 hash "this evaluate to false"
Seeing the same with aconcagua
| teaspoons aHalfTeaspoon anotherHalfTeaspoon |
teaspoons := BaseUnit named: 'teaspoons'.
aHalfTeaspoon := Measure amount: 1/2 unit: teaspoons.
anotherHalfTeaspoon := Measure amount: 0.5 unit: teaspoons.
"#="
aHalfTeaspoon = anotherHalfTeaspoon "this evaluate to true"
aHalfTeaspoon ~= anotherHalfTeaspoon "this evaluate to false"
aHalfTeaspoon unit = anotherHalfTeaspoon unit "this evaluate to true"
aHalfTeaspoon unit ~= anotherHalfTeaspoon unit "this evaluate to false"
aHalfTeaspoon amount = anotherHalfTeaspoon amount "this evaluate to true"
aHalfTeaspoon amount ~= anotherHalfTeaspoon amount "this evaluate to false"
"#hash"
aHalfTeaspoon hash = anotherHalfTeaspoon hash "this evaluate to true"
aHalfTeaspoon hash ~= anotherHalfTeaspoon hash "this evaluate to false"
aHalfTeaspoon unit hash = anotherHalfTeaspoon unit hash "this evaluate to true"
aHalfTeaspoon unit hash ~= anotherHalfTeaspoon unit hash "this evaluate to false"
aHalfTeaspoon amount hash = anotherHalfTeaspoon amount hash "this evaluate to true"
aHalfTeaspoon amount hash ~= anotherHalfTeaspoon amount hash "this evaluate to false"
So, I don't see where is the bug.
Regards.