How about adding rational fraction to Python?

Torsten Bronger bronger at
Tue Feb 26 21:41:01 CET 2008


Grant Edwards writes:

> [...]
> Nope.  I would prefer that int OP int always produce an int.

And 2**-1?

Your formulation tries to suggest some sort of logical consequence
but in my opinion, it's still a mere matter of taste and habits.  I
remember my first steps in C++ 12 years ago when I tried to
implement a couple of astronomical formulae, always getting false
results because C++ calculated 3/4=0.

I think the only real reason for people prefering int/int=int is
that computers can deal with inteters better than with floats,
resulting in int-only arithmetic in computer languages.  However, I
don't consider this a particularly good reason.


Torsten Bronger, aquisgrana, europa vetus
                                      Jabber ID: bronger at
               (See for further contact info.)

More information about the Python-list mailing list