On Sun, Jul 17, 2016 at 7:27 AM, Marko Rauhamaa <ma...@pacujo.net> wrote:
> Chris Angelico <ros...@gmail.com>:
>
>> In that case, an 'Exact' non-integer will have appalling performance -
>> fractions.Fraction doesn't really work all that nicely when the
>> numbers start getting huge.
>
> In Scheme, any math operation is allowed to drop exactness:
>
>    If one of these procedures is unable to deliver an exact result when
>    given exact arguments, then it may either report a violation of an
>    implementation restriction or it may silently coerce its result to an
>    inexact number.

The trouble is, repeated addition of fractions is *able* to deliver an
exact result. It just might result in an incredibly slow program. And
then if you mix types, does it aim for the greatest possible
'accuracy', even if that's not quite accurate? (For instance, if you
add 0.2 to 5/8, does it convert to float or to fraction?)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to