On Monday, March 24, 2014 1:31:23 AM UTC-7, Sergey Kirpichev wrote: > > > On Monday, March 24, 2014 4:58:02 AM UTC+4, Richard Fateman wrote: >> >> So is every double-precision IEEE float (except inf and NaN) convertible >> to the >> exact rational number which it represents in the form integer/integer. >> > > It was noted in this thread several times: we are not interested > in this truism. The problem is not with the data structure, but with > operations. > Field properties doesn't hold for floats, it was shown for you several > times in this > thread (CLisp example included). > > >> 2. we can deduce from the fact that a,b are rational numbers that a+b is >> a rational number. >> > > But now, suppose a, b and c - rational numbers. Then we can deduce: > ((a + b) + c) - (a + (b + c)) is zero. But this conclusion will be wrong > if > we count floats as rationals. >
Your problem is that the notions of + and - in your computer programming language are apparently inadequate. It is certainly possible to do this correctly by converting a,b,c into ratios of integers, which provides sympy a hint about how it should be doing the arithmetic, and getting 0. The fact that + gets different answers for adding numbers a,b and for adding a', b' where a-a' and b=b' can't be a good thing in a system that is supposed to do mathematics. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/bed479fc-e69d-457a-b7df-b2916aca7656%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
