Re: Using fractions instead of floats

2007-10-01 Thread andresj
> > On 2007-10-01, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > > Finally, arithmetic would become very confusing if there were > > > three distinct numeric types; it already causes enough > > > confusion with two! Well, yeah... I get what you are saying, that would be confusing... Terry Re

Re: Using fractions instead of floats

2007-09-30 Thread andresj
On Sep 30, 6:48 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > andresj <[EMAIL PROTECTED]> writes: > > The problem arises when you try to represent some number, like 0.4 in > > a float. > > Which is really a specific case of the general problem that, for any >

Using fractions instead of floats

2007-09-30 Thread andresj
I was doing some programming in Python, and the idea came to my mind: using fractions instead of floats when doing 2/5. The problem arises when you try to represent some number, like 0.4 in a float. It will tell you that it's equal to 0.40002. "This is easy to fix", you may say. "You j