Bug or Feature?
stephan.diehlNOSPAM at gmx.net
Tue Nov 25 16:04:57 CET 2003
Dang Griffith wrote:
> On Mon, 24 Nov 2003 19:35:51 +0100, Stephan Diehl
> <stephan.diehlNOSPAM at gmx.net> wrote:
>>Dang Griffith wrote:
>>> On Mon, 24 Nov 2003 18:13:34 +0100, Stephan Diehl
>>> <stephan.diehlNOSPAM at gmx.net> wrote:
>>>>This is probably more a theoretical question, but if I decide to have an
>>>>operation within one specific domain, I want the result in that domain
>>>>too. Otherwise, there would be no point at all to define such a numeric
>>>>class at all.
>>> I understand what you're saying, but there's no universal rule that
>>> says that the result of operations between members of a set are also
>>> members of the set. Obvious examples include division on the set of
>>> integers, and division over the set of real numbers, i.e.division by
>>> zero is not a real number.
>>If we have a look at the mathematical definition of numbers, the
>>interesting thing is not the set of these numbers, but the set combined
>>with some usefull operators (like addition and multiplication).
>>It is (mathematicaly speaking) not possible to have a result under these
>>operations that are outside the definition.
>>In that sense, there IS this universal rule, you were talking about. (and
>>division by zero is just not allowed by definition).
> And for the set of whole numbers, some divisions are allowed, but any
> division that results in a fraction would not be allowed. By
> definition, i.e. a combination of operators and operands that result
> in a value not in the same domain is not a valid combination. It
> works, but seems circular. :-)
You might have noticed, I was talking about Mathematics, not the imperfect
implementation of it in computers :-)
To have division as a meaningfull operation, the set in question must be a
group under the '*' operation (See for example
The point is, that division is the reverse operation to multiplication.
More information about the Python-list