package conex

  1. Overview
  2. Docs

64 bit unsigned integer with explicit overflow behaviour (see Uint.succ).

type t

A 64 bit unsigned integer (using a int64).

val zero : t

zero is the smallest member.

val compare : t -> t -> int

compare a b is res: 0 if a = b, -1 if a < b, 1 if a > b

val succ : t -> bool * t

succ t is carry, next: if carry is true, an overflow happened. next is always the next integer in the Z/2^64-1Z group.

val to_string : t -> string

to_string t is t converted to a string in hexadecimal (%LX).

val pp : t fmt

pp is a pretty printer

val decimal : t -> string

decimal t is t converted to a string in decimal (%Lu).

val of_string : string -> t option

of_string s attempts to parse the string s as hexadecimal encoded number using Int64.of_string "0x" ^ s.

val of_float : float -> t option

of_float f is Int64.of_float f if f >= 0.0.

val of_int : int -> t option

of_int i is Int64.of_int i if i >= 0.

val of_int_exn : int -> t

of_int_exn i is Int64.of_int i if i >= 0, raises an exception on failure.

OCaml

Innovation. Community. Security.