module Uint16: sig .. end
Unsigned 16 bit integers, ranging from 0 to 2 ^ 16 - 1 (65535).
type t = int
Type of an unsigned 16 bit integer. It is represented as an int
val pp : Format.formatter -> t -> unit
pp ppf u prints the unsigned 16bit integer in hex encoding.
val of_int : int -> t
of_int i is the integer i converted to an unsigned 16 bit integer.
Raises Invalid_argument if the integer is out of range.
val add : t -> t -> t * bool
add t t' is (r, carry), where r is t + t' mod (2 ^ 16 - 1). If
the sum does not fit into 16 bits, carry is true, otherwise it is
false.
val mul : t -> t -> t * bool
mul t t' is (r, carry), where r is t * t' mod (2 ^ 16 - 1). If
the product does not fit into 16 bits, carry is true, otherwise it is
false.
val sub : t -> t -> t * bool
sub t t' is (r, carry), where r is t - t' mod (2 ^ 16 - 1). If
t is smaller than t', carry is true, otherwise it is false.
val succ : t -> t * bool
succ t is the successor of
t:
Usane.Uint16.add t 1l. If
t is
2 ^ 16 - 1,
carry is
true, otherwise it is
false.
val pred : t -> t * bool
pred t is the predecessor of
t:
Usane.Uint16.sub t 1l. If
t is
0,
carry
is
true, otherwise it is
false.
val compare : t -> t -> int
compare t t' is
-1 if t is smaller than t',
0 if t and t' are equal,
1 if t is greater than t'.
val (+) : t -> t -> t * bool
val (-) : t -> t -> t * bool
val ( * ) : t -> t -> t * bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool