On Sun, Jul 17, 2016 at 5:41 PM, Marko Rauhamaa <[email protected]> wrote: > Chris Angelico <[email protected]>: > >> The trouble is, repeated addition of fractions is *able* to deliver an >> exact result. It just might result in an incredibly slow program. > > True, although the programmer has control over the feature. If you > *want* the luxury of exact fractions, you pay the price. If you don't, > you make the numbers inexact.
Not if you have a single "Number" type: On Sat, Jul 16, 2016 at 4:53 PM, Random832 <[email protected]> wrote: > Eliminate both of them. Move to a single abstract numeric type* a la > Scheme, with an "inexact" attribute (inexact numbers may or may not be > represented by a float, or by the same bigint/decimal/rational types as > exact ones with a flag set to mark them as inexact.) Currently yes, you can choose to use fractions.Fraction and pay the price. How, if you have a single type with different representations, can you make that choice? ChrisA -- https://mail.python.org/mailman/listinfo/python-list
