Robert Bradshaw wrote:
> I'm less sure about how to expose the C operations, but just  
> accepting a 20-30% slowdown is not acceptable. We should provide  
> cython.cmod/cdiv, but I feel strongly we should provide an infix  
> option as well. I'm wary of introducing new operators, but the  
> %-, /-, and //- seems like the best options proposed. It is a bit  
> deceptive though, as we would not force the truncating rounding mode  
> for negative numbers, just pass it on to the C compiler (are there  
> any that don't make this choice?). Another option is to do something  
> very like c(%) or c_op(%), which is currently unused invalid syntax.  

How about this:

cdef int a = -5, b = 3

print a.cmod(b), a.cdiv(b)

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

Reply via email to