[Pharo-dev] float & fraction equality bug

raffaello.giulietti at lifeware.ch raffaello.giulietti at lifeware.ch
Thu Nov 9 16:15:53 EST 2017


On 2017-11-09 21:49, Stephane Ducasse wrote:
> On Thu, Nov 9, 2017 at 5:34 PM, Nicolas Cellier
> <nicolas.cellier.aka.nice at gmail.com> wrote:
>> Note that this started a long time ago and comes up episodically
>> http://forum.world.st/Fraction-equality-and-Float-infinity-problem-td48323.html
>> http://forum.world.st/BUG-Equality-should-be-transitive-tc1404335.html
>> https://lists.gforge.inria.fr/pipermail/pharo-project/2009-July/010496.html
>>
>> A bit like a "marronnier" (in French, a subject that is treated periodically
>> by newspapers and magazines)
> 
> Hi nicolas except that now we could a chapter describing some of the answers :)
> 

It's easy to make = behave as an equivalence if the two objects it
operates on are of the same class.

But it is well-known that it's hard when their classes are different,
short of implementing = trivially in this case.

This is to say that there's no real hope to make = an equivalence if the
wish is to make it useful in the presence of different kind of objects.

In the context of numeric computations, luckily, there is some hope when
conversions, if possible at all, are all performed consistently. But the
same conversions should then be applied for all operations, whether
comparisons or subtractions, etc., to ensure more familiar properties.
This is not currently the case in Pharo.



Raffaello




More information about the Pharo-dev mailing list