CCNativeint.Infix
x / y
is the integer quotient of x
and y
. Integer division. Raise Division_by_zero
if the second argument y
is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/)
.
x mod y
is the integer remainder of x / y
. If y <> zero
, the result of x mod y
satisfies the following properties: zero <= x mod y < abs y
and x = ((x / y) * y) + (x mod y)
. If y = 0
, x mod y
raises Division_by_zero
.
x lsl y
shifts x
to the left by y
bits. The result is unspecified if y < 0
or y >= bitsize
, where bitsize
is 32
on a 32-bit platform and 64
on a 64-bit platform.
x lsr y
shifts x
to the right by y
bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x
. The result is unspecified if y < 0
or y >= bitsize
.
x asr y
shifts x
to the right by y
bits. This is an arithmetic shift: the sign bit of x
is replicated and inserted in the vacated bits. The result is unspecified if y < 0
or y >= bitsize
.