How about adding rational fraction to Python?

Lie Lie.1296 at gmail.com
Tue Feb 26 10:41:48 EST 2008


On Feb 26, 10:17 pm, "D'Arcy J.M. Cain" <da... at druid.net> wrote:
>Carl Banks <pavlovevide... at gmail.com> wrote:
>> On Feb 26, 9:29 am, "D'Arcy J.M. Cain" <da... at druid.net> wrote:
>> > If 3/4 ever returned 0.75 in any language I would drop that language.
>
>> Have fun dropping Python, then, chief.  Integer division with / is
>> already deprecated, can be disabled ever since Python 2.4, and will be
>> wholly removed in Python 3.0.
>
>I have not been following Python development that closely lately so I
>was not aware of that. I guess I won't be going to Python 3 then.  It's
>great that Python wants to attract young, new programmers.  Too bad
>about us old farts I guess.

Don't worry, Python would still have integer division (// - double
slash), if you still prefer integer division.

> Lie <Lie.1... at gmail.com> wrote:
> > The problem lies on which maths is the real maths? In real world, 3/4
> > is 0.75 is 0.75 and that's an unchangeable fact, so programming
>
> Which real world is that?  In my real world 3/4 is 0 with a remainder
> of 3.  What happens to that 3 depends on the context.  When I worked
> with a youth soccer group I was pretty sure that I would be disciplined
> if I carved up a seven year old player so that I could put 0.75 of a
> child on a team.

lol, when counting how much players needed you wouldn't do a division,
you count from one to eleven (a.k.a addition by one a.k.a. increment),
excepting at the point where number of available players + current
count = 11 (+ spares) (or better, you subtract the number of players
to the number of players required). Save the float division for the
time, 90 minutes / number of players if you wanted each child to play
an equal amount of time.

Good joke, and a true argument, I don't wish to see anyone chopped off
because I said floating point division is better.



More information about the Python-list mailing list