Module Numeral
Arbitrary precision integers
- author
- Christoph Sticksel
Pretty-printing and String Representation
val pp_print_numeral : Stdlib.Format.formatter -> t -> unitPretty-print a numeral, e.g. -1
val pp_print_numeral_sexpr : Stdlib.Format.formatter -> t -> unitPretty-print a numeral in s-expression, e.g. (- 1)
val string_of_numeral : t -> stringReturn a string representation of a numeral
Conversions
val of_int : int -> tConvert an integer to a numeral
val of_big_int : Big_int.big_int -> tConvert an arbitrary large integer numeral to numeral
val of_string : string -> tConvert a string to numeral
val to_int : t -> intConvert a numeral to an integer
Raises the exception
Failure "int_of_big_int"if the numeral cannot be represented as an integer.
val to_big_int : t -> Big_int.big_intConvert a numeral to an arbitrary large integer
Constructors
val zero : tThe numeral zero
val one : tThe numeral one
Arithmetic operations
val incr : t Stdlib.ref -> unitIncrement a numeral in a reference by one
val decr : t Stdlib.ref -> unitDecrement a numeral in a reference by one