Ignacio, not sure your bank handle money with inexact floating point arithmetic... ScaledDecimal are made for that. When they want to "round" your account, they have more efficient rules (like the one named 'Frais Bancaires' in France). Such rules are more predictable and rarely with fractions but rather integer numbers of â¬, always negative ;) This apart, I personnally did not choose to sacrifice anything. Your hardware did this well before I put my hands on a keyboard. I think you mis-understand the point. I'm waiting the answer why 1.3*1.3 is different from 169/100. When you'll have discovered this, we'll talk about 13/10 = 1.3 on more serious bases. Nicolas 2009/7/8 Ignacio Vivona <altobarba@gmail.com>:
In school teachers told me that 13/10 = 1.3, applications that handle money believe the same (at least the ones that i worked on) and then we have to use some other implementation of numbers because the 3d guys (i also coded some 3d stuff in C) and the speed guys want the default numbers to be fast and inaccurate. Why not the opposite? If you want speed and you are willing to sacrifices presition then use the implementation alternative.
On Tue, Jul 7, 2009 at 9:43 PM, Andres Valloud <avalloud@smalltalk.comcastbiz.net> wrote:
The VW tests use something along the lines of
self assert: aResult isWithin: anInteger ulpsFrom: anExpectedValue
Igor Stasenko wrote:
As a compromise, i propose adding:
Float>>isAlmostZero  ^ self abs < Epsilon
And write tests like:
(13/10) = 1.3
in form:
((13/10) - 1.3) isAlmostZero
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Hope is for sissies (Gregory House, M.D.)
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project