Future division patch available (PEP 238)

Martin von Loewis loewis at informatik.hu-berlin.de
Mon Jul 23 06:54:53 EDT 2001


David Eppstein <eppstein at ics.uci.edu> writes:

> > Division in the set of integers can only have
> > an integer result by definition. The fact that in mathematics it is
> > common to assume real numbers even if no point is specified is largely
> > irrelevant - programmers often have to be more explicit than
> > mathemeticians because programs are read by computers - not people.
> 
> As a further point in this direction, floats are *not* the same as real 
> numbers and it is usually a mistake to forget this.  In mathematics, the 
> result of dividing two integers is a rational number.

Floating point numbers are often seen as an acceptable approximation
of both rational and real numbers, given that an exact representation
of arbitrary rational and real numbers may require unbounded memory,
or may make computations on them unfeasible.

Regards,
Martin



More information about the Python-list mailing list