Using fractions instead of floats

Arnaud Delobelle arnodel at googlemail.com
Mon Oct 1 16:59:25 EDT 2007


On Oct 1, 6:26 pm, Neil Cerutti <horp... at yahoo.com> wrote:
> On 2007-10-01, Arnaud Delobelle <arno... at googlemail.com> wrote:
>
> > Finally, arithmetic would become very confusing if there were
> > three distinct numeric types; it already causes enough
> > confusion with two!
>
> Scheme says: It's not that bad.

Scheme has prefix numeric operators, so that 1/2 is unambiguously (for
the interpreter and the user) a litteral for 'the fraction 1/2'. You
can't avoid the confusion in python, as binary operators are infix. Of
course, we could create a new kind of litteral.  Let's see, / and //
are already operators, so why not use /// ? ;)

--
Arnaud





More information about the Python-list mailing list