Mark Jackson wrote: > Imbaud Pierre <[EMAIL PROTECTED]> writes: > > integer division and modulo gives different results in c and python, > > when negative numbers > > are involved. take gdb as a widely available c interpreter > > print -2 /3 > > 0 for c, -1 for python. > > more amazing, modulos of negative number give negative values! (in c). > > from an algebraic point of view, python seems right, but I thought > > python conformity to the underlying c compiler was a strong commitment, > > AIUI the C standard is silent on the issue, and hence the C behavior is > implementation-dependent.
The *original* C standard is silent on the issue, but the current standard requires the wrong behavior. -- http://mail.python.org/mailman/listinfo/python-list