[Python-bugs-list] [ python-Bugs-508269 ] 'true' division - perceived misnormer

noreply@sourceforge.net noreply@sourceforge.net
Fri, 25 Jan 2002 06:06:38 -0800


Bugs item #508269, was opened at 2002-01-24 18:37
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=508269&group_id=5470

Category: Documentation
Group: Python 2.2
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Sverker Nilsson (svenil)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: 'true' division - perceived misnormer

Initial Comment:
Documentation misnormer. In 5.6 Binary arithmetic
operations, in the 3d paragraph it says about
division: "The result is that of  mathematical 
division  with the 'floor' function applied to
the result..."

I think this is a misnormer. I would say the
integer division is neither less or more
"mathematical" than the floating point division.

More correct would be to say that it is the
quotient from the mathematical group division
algorithm (if positive at least). Or say that

"the result is that of mathematical real number
division with the floor operator applied to the
result."

Also the name in the objects, "__truediv__", is a
misnormer.  It would be better to call it
"__floatdiv__", if that is what it is intended to
be.

If this is an argument to not change the current
division operator, so much the better, I would
rather keep it as it is and add a new operator for
the floating point coercive division instead. For
one thing, it would keep it close to the main de
facto industry standards, C and Ada comes to
mind. Well I guess that discussion is long
overdue.... just my 2 cents.

Reference: In the Abstract Algebra course
I had at the university a few years ago, there
was something called the "division algorithm".
It defined mathematically the quotient and remainder.
This was defined in structures called "groups",
which the mathematical (positive) integers is
an example of. The real numbers and operators
make up a 'field', but those are not more
or less 'mathematical' than groups. 

Sverker


----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-01-25 06:06

Message:
Logged In: YES 
user_id=6380

We've spent months discussing this on usenix, and everything
you say has been said many times.

----------------------------------------------------------------------

Comment By: Sverker Nilsson (svenil)
Date: 2002-01-24 19:07

Message:
Logged In: YES 
user_id=356603

Forget what I said about 'groups', after checking
it turns out the integers are actually a 'commutative ring':

http://www.math.niu.edu/~beachy/aaol/rings.html#5108

I passed that abstract algebra a few years ago but
forgot already... My main point stands though, there
is actually a mathematical theorem called the
'division algorithm for integers':

http://www.math.niu.edu/~beachy/aaol/integers.html#1103

Sverker



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=508269&group_id=5470