-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Triton has a nice paragraph explaining differences from NumPy semantics. We should also have this, and check these examples.
Differences with NumPy¶
C rounding in integer division Operators in Triton follow C semantics rather than Python semantics for efficiency. As such, int // int implements rounding towards zero as in C for integers of mixed signs, rather than rounding towards minus infinity as in Python. For the same reason, the modulus operator int % int (which is defined as a % b = a - b * (a // b)) also follows C semantics rather than Python semantics.
Perhaps confusingly, integer division and modulus follow Python semantics for computations where all the inputs are scalars.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels