Carl Witty wrote:
> I just reported http://trac.cython.org/cython_trac/ticket/229, which
> points out that division and % on cdef ints have C rather than Python
> semantics (for instance, (-1 % 16) is -1 in C, and 15 in Python).
> 
> I'm not sure what the right thing to do here is.  Using C semantics
> gives faster code.  Using Python semantics is nicer (whenever I care
> about the difference, I always want Python semantics) but slower, and
> would be confusing to somebody who was coming from C.

I'm +1 on Python semantics. We could make the C version available under 
some obscure name for any case when one really wants the speed, like 
cython.fast_c_mod(-1, 16).

-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to