Checked_oint
checked_oint
is an OCaml library for checked integer arithmetic.
This library supports signed and unsigned integers of bitnesses 8, 16, 32, 64, and 128. S
is the main signature that contains common operations for all integer types; specific implementations are named U8
, U16
, and so on.
val pp_u8 :
Ppx_deriving_runtime.Format.formatter ->
u8 ->
Ppx_deriving_runtime.unit
val show_u8 : u8 -> Ppx_deriving_runtime.string
val pp_u16 :
Ppx_deriving_runtime.Format.formatter ->
u16 ->
Ppx_deriving_runtime.unit
val show_u16 : u16 -> Ppx_deriving_runtime.string
val pp_u32 :
Ppx_deriving_runtime.Format.formatter ->
u32 ->
Ppx_deriving_runtime.unit
val show_u32 : u32 -> Ppx_deriving_runtime.string
val pp_u64 :
Ppx_deriving_runtime.Format.formatter ->
u64 ->
Ppx_deriving_runtime.unit
val show_u64 : u64 -> Ppx_deriving_runtime.string
val pp_u128 :
Ppx_deriving_runtime.Format.formatter ->
u128 ->
Ppx_deriving_runtime.unit
val show_u128 : u128 -> Ppx_deriving_runtime.string
val pp_i8 :
Ppx_deriving_runtime.Format.formatter ->
i8 ->
Ppx_deriving_runtime.unit
val show_i8 : i8 -> Ppx_deriving_runtime.string
val pp_i16 :
Ppx_deriving_runtime.Format.formatter ->
i16 ->
Ppx_deriving_runtime.unit
val show_i16 : i16 -> Ppx_deriving_runtime.string
val pp_i32 :
Ppx_deriving_runtime.Format.formatter ->
i32 ->
Ppx_deriving_runtime.unit
val show_i32 : i32 -> Ppx_deriving_runtime.string
val pp_i64 :
Ppx_deriving_runtime.Format.formatter ->
i64 ->
Ppx_deriving_runtime.unit
val show_i64 : i64 -> Ppx_deriving_runtime.string
val pp_i128 :
Ppx_deriving_runtime.Format.formatter ->
i128 ->
Ppx_deriving_runtime.unit
val show_i128 : i128 -> Ppx_deriving_runtime.string
val pp_generic :
Ppx_deriving_runtime.Format.formatter ->
generic ->
Ppx_deriving_runtime.unit
val show_generic : generic -> Ppx_deriving_runtime.string
val equal_signedness : signedness -> signedness -> Ppx_deriving_runtime.bool
val pp_signedness :
Ppx_deriving_runtime.Format.formatter ->
signedness ->
Ppx_deriving_runtime.unit
val show_signedness : signedness -> Ppx_deriving_runtime.string
val all_of_signedness : signedness list
val pp_bitness :
Ppx_deriving_runtime.Format.formatter ->
bitness ->
Ppx_deriving_runtime.unit
val show_bitness : bitness -> Ppx_deriving_runtime.string
val all_of_bitness : bitness list
type int_ty = signedness * bitness
Represents an integer type.
val pp_int_ty :
Ppx_deriving_runtime.Format.formatter ->
int_ty ->
Ppx_deriving_runtime.unit
val show_int_ty : int_ty -> Ppx_deriving_runtime.string
val all_of_int_ty : int_ty list
val is_zero : generic -> bool
true
if the integer is 0, false
otherwise.
val is_one : generic -> bool
true
if the integer is 1, false
otherwise.
val is_all_ones : generic -> bool
true
if the integer has all bits set to 1, false
otherwise.
module type S = sig ... end
The signature of operations on integers.
module type Singleton = sig ... end
A single integer of an arbitrary type.
module type Pair = sig ... end
A pair of integers of an arbitrary type.