On 7-Jul-09, at 2:46 PM, Nicolas Cellier wrote:
> I repeat here my arguments:
> Anyone depending on (13/10) = 1.3 is plain wrong...


Historically and as far as I can tell in all other versions of  
smalltalk (13/10) = 1.3   why be different?
If you *want* exact then I suggest you have (13/10)  
asAInexactFloatExactlyEquals: 1.3     and let who wants that type of  
compare live with it.

As for real world examples.

http://www.mobilewikiserver.com/Fraction.html

has 104 test cases, unluckily the the math ones didn't trigger a  
failure but the calculator keyboard entry engine did

" Test to enter .1 in memory storage, then confirm retrieval works"

        self tap: '.'.
        self tap: 1.
        self tap: 'S'.
        self should: [self enteredData = '.1'].
        self should: [self storedEntry = 0.1].

because
(1/10) = 0.1  => false

Sometimes what is false can be true because well people do think 1/10  
= 0.1


--
= 
= 
= 
========================================================================
John M. McIntosh <[email protected]>   Twitter:   
squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================





_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to