On Sat, 27 Nov 2010 15:44:38 -0800, casevh wrote:

> I think most users are expecting infinite precision when they use
> rationals. Trying to explain limited precision rational arithmetic might
> be interesting.

Most users are expecting infinite precision decimals when they use 
floats, and get surprised and dismayed by things like these:

>>> sum([0.1]*10) == 1
False

>>> 0.1 + 1e50 + 0.1 - 1e50
0.0

>>> a, b, c = 0.1, 0.7, 0.3
>>> a*b + a*c == a*(b+c)
False


Trying to explain arithmetic on computers is interesting, no matter what 
you use.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to