You say that the first two results are wrong.
No.�� The first two results are *exactly* what they are supposed to be.
Floating point arithmetic is NOT mathematical real arithmetic.
The floating point *numbers* are exact rational numbers of the form
n * 2^k where n is a (bounded) integer and k is a (bounded) integer.
If you enter a number that is not of this form (and within bounds)
you will get a *different* number that *is* of that form and is close.
The floating point *operations* in IEEE arithmetic are exact
when and only when the result is a number of that form (and within
bounds), otherwise the result is *approximate*.
If you want exact arithmetic on numbers of the form n * 10^k,
ANSI Smalltalk provides the ScaledDecimal class, which, sigh,
Squeak and Pharo interpret as "rational number *printed* in
decimal form but not *computed* using decimal arithmetic", so
that can give extremely confusing results too.
So what you are going to have to do is use rational numbers,
which are in Smalltalk the union of Integer and Fraction.