How about adding rational fraction to Python?

Arnaud Delobelle arnodel at googlemail.com
Tue Feb 26 17:00:03 EST 2008


On Feb 26, 9:47 pm, Steven D'Aprano <st... at REMOVE-THIS-
cybersource.com.au> wrote:
> On Tue, 26 Feb 2008 11:43:56 -0500, D'Arcy J.M. Cain wrote:
> > Integer division means integer result to me in a very real sense.
>
> So, when you have five children over for a birthday party, and one cake,
> do you say "Sorry kids, no cake for you: one cake divided by five is
> zero"?
>
> Of course you do, you big meanie. I think you catered for my 12th
> birthday party.

Whereas I bet you would be able to share the cake equally and each
child would get 0.20000000000000001 of a cake :)

Or perhaps it would be better to have 2**n guests...
Or maybe one should think of the cake as 1.0 cake, as experience shows
that cakes can be cut...

--
Arnaud




More information about the Python-list mailing list