[BUG] Equality should be transitive

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[BUG] Equality should be transitive

Nicolas Cellier-3

| a b c |
a := 16r1FFFFFFFFFFFFF0.
b := a asDouble.
c := a + 1.
(a = b) & (b = c) ifTrue: [self assert: (a = c)]
         "note: this is squeak imply operator
         self assert: (a = b) & (b = c) ==> (a = c)"


| a b c |
a := 16r1FFFFFFFFFFFFF0.
b := a asDouble.
c := a + 1.
(a = b) & (a < c) ifTrue: [self assert: (b < c)]
         "note: this is squeak imply operator
         self assert: (a = b) & (a < c) ==> (b < c)"

Current implementation (in VW/Squeak/Dolphin/STX/gst etc...) is incorrectly
coercing to Double in order to perform comparisons.

I claim on the contrary that it should convert double asTrueFraction in order
to perform comparison.

These bugs have various consequences on Sets (size might depend on order which
elements are added)

And it is scratching formal beauty of my favourite language.

So please, include patch from open source repository SYSBUG-FloatComparison