On 11/10/2017 03:59 AM, [email protected] wrote:
I would like to summarize my perspective of what emerged from the
discussions in the "float & fraction equality bug" trail.
The topic is all about mixed operations when both Fractions and Floats
are involved in the mix and can be restated as the question of whether
it is better to automagically convert the Float to a Fraction or the
Fraction to a Float before performing the operation.
AFAIK, Pharo currently implements a dual-conversion strategy:
(1) it applies Float->Fraction for comparison like =, <=, etc.
(2) it applies Fraction->Float for operations like +, *, etc.
[...]
Thanks for the summary, Raffaello.
One can choose to convert Float -> Fraction (because fraction is the
more general format, in that it can represent more of the real numbers)
or to convert Fraction->Float (because a Float is considered an
approximation of a real number).
But more important, I think, is that whichever choice is made, the
*same* choice must be made in *all* operations that involve both Floats
and Fractions.
Regards,
-Martin