Module Int64_u.OSource

A sub-module designed to be opened to make working with ints more convenient.

Sourceval (+) : t -> t -> t [@@zero_alloc]
Sourceval (-) : t -> t -> t [@@zero_alloc]
Sourceval (*) : t -> t -> t [@@zero_alloc]
Sourceval (/) : t -> t -> t [@@zero_alloc]
Sourceval (~-) : t -> t [@@zero_alloc]
Sourceval (**) : t -> t -> t

Integer exponentiation

Sourceval (=) : t -> t -> Base.bool [@@zero_alloc]
Sourceval (<>) : t -> t -> Base.bool [@@zero_alloc]
Sourceval (<) : t -> t -> Base.bool [@@zero_alloc]
Sourceval (>) : t -> t -> Base.bool [@@zero_alloc]
Sourceval (<=) : t -> t -> Base.bool [@@zero_alloc]
Sourceval (>=) : t -> t -> Base.bool [@@zero_alloc]
Sourceval (land) : t -> t -> t [@@zero_alloc]

Same as bit_and/or/xor/not

Sourceval (lor) : t -> t -> t [@@zero_alloc]
Sourceval (lxor) : t -> t -> t [@@zero_alloc]
Sourceval lnot : t -> t [@@zero_alloc]
Sourceval abs : t -> t [@@zero_alloc]

Returns the absolute value of the argument. May be negative if the input is min_value.

Sourceval neg : t -> t [@@zero_alloc]

Negation

Sourceval zero : t

There are two pairs of integer division and remainder functions, /% and %, and / and rem. They both satisfy the same equation relating the quotient and the remainder:

  x = (x /% y * y) + (x % y);
  x = (x / y * y) + rem x y

The functions return the same values if x and y are positive. They all raise if y = 0.

The functions differ if x < 0 or y < 0.

If y < 0, then % and /% raise, whereas / and rem do not.

x % y always returns a value between 0 and y - 1, even when x < 0. On the other hand, rem x y returns a negative value if and only if x < 0; that value satisfies abs (rem x y) <= abs y - 1.

Sourceval (%) : t -> t -> t [@@zero_alloc]
Sourceval (/%) : t -> t -> t [@@zero_alloc]
Sourceval (//) : t -> t -> Base.float# [@@zero_alloc]

Float division of integers.

Sourceval (lsl) : t -> Base.int -> t [@@zero_alloc]

Same as shift_left

Sourceval (asr) : t -> Base.int -> t [@@zero_alloc]

Same as shift_right.

Sourceval (lsr) : t -> Base.int -> t [@@zero_alloc]

Same as shift_right_logical.