raiseNotImplementedError("For integer arguments the behavior of division in C and in Python differ when the quotient is negative (to implement).")
return"%(z)s = ((double)%(x)s) / %(y)s;"%locals()
return"%(z)s = %(x)s / %(y)s;"%locals()
defgrad(self,(x,y),(gz,)):
returngz/y,-(gz*x)/(y*y)
div=Div(upcast_out,name='div')
true_div=TrueDiv(upcast_out,name='true_div')
classIntDiv(BinaryScalarOp):
defimpl(self,x,y):
returnx//y
defc_code(self,node,name,(x,y),(z,),sub):
raiseNotImplementedError("For integer arguments the behavior of division in C and in Python [can] differ when the quotient is negative. C actually does not even specify a correct behaviour in this case, it is up to the chip.")