Integer division and remainder

Alex Martelli aleaxit at yahoo.com
Wed Aug 15 09:16:13 EDT 2001


"Paul Rubin" <phr-n2001 at nightsong.com> wrote in message
news:7xpu9xqynj.fsf at ruckus.brouhaha.com...
    ...
> I think C99 made a mistake in specifying it one way or the other.  C
> doesn't have the same goals as python.  Languages like python should
> specify these things precisely.  Languages like C should leave more
> things up to the hardware.

Actually, in many cases Python leaves things up (shouldn't that
be down?-) to the underlying C runtime library, I guess for speed
and implementation/porting convenience; flooring int division is
one of the happy exceptions (module time, OTOH, leaves so much
to the underlying library that it's almost unusable cross-platform --
one can't even parse a date/time string with it, portably... thanks
be for Lemburg's mxDateTime!-).

I do agree with you that precise specification (and the resulting
cross-platform portability) is a great idea -- but I guess one could
use Jython and a JVM to get that at the expense of speed and
convenience...:-).


Alex






More information about the Python-list mailing list