sig
exception InvalidConstantLiteral of int * string
type int_value = BigInt.t
type int_literal_kind = ILitUnk | ILitDec | ILitHex | ILitOct | ILitBin
type int_constant = {
il_kind : Number.int_literal_kind;
il_int : Number.int_value;
}
type real_value = private {
rv_sig : BigInt.t;
rv_pow2 : BigInt.t;
rv_pow5 : BigInt.t;
}
type real_literal_kind = RLitUnk | RLitDec of int | RLitHex of int
type real_constant = {
rl_kind : Number.real_literal_kind;
rl_real : Number.real_value;
}
val neg_int : Number.int_constant -> Number.int_constant
val abs_int : Number.int_constant -> Number.int_constant
val neg_real : Number.real_constant -> Number.real_constant
val abs_real : Number.real_constant -> Number.real_constant
val compare_real :
?structural:bool -> Number.real_value -> Number.real_value -> int
val int_literal :
Number.int_literal_kind -> neg:bool -> string -> Number.int_constant
val real_literal :
radix:int ->
neg:bool ->
int:string -> frac:string -> exp:string option -> Number.real_constant
val real_value :
?pow2:BigInt.t -> ?pow5:BigInt.t -> BigInt.t -> Number.real_value
type default_format = Stdlib.Format.formatter -> string -> unit
type integer_format = Stdlib.Format.formatter -> BigInt.t -> unit
type real_format =
Stdlib.Format.formatter -> string -> string -> string option -> unit
type frac_real_format =
(Stdlib.Format.formatter -> string -> unit) *
(Stdlib.Format.formatter -> string -> string -> unit)
type delayed_format =
Stdlib.Format.formatter -> (Stdlib.Format.formatter -> unit) -> unit
type number_support = {
long_int_support : [ `Custom of Number.default_format | `Default ];
negative_int_support : [ `Custom of Number.delayed_format | `Default ];
dec_int_support :
[ `Custom of Number.integer_format
| `Default
| `Unsupported of Number.default_format ];
hex_int_support :
[ `Custom of Number.integer_format | `Default | `Unsupported ];
oct_int_support :
[ `Custom of Number.integer_format | `Default | `Unsupported ];
bin_int_support :
[ `Custom of Number.integer_format | `Default | `Unsupported ];
negative_real_support : [ `Custom of Number.delayed_format | `Default ];
dec_real_support :
[ `Custom of Number.real_format | `Default | `Unsupported ];
hex_real_support :
[ `Custom of Number.real_format | `Default | `Unsupported ];
frac_real_support :
[ `Custom of Number.frac_real_format
| `Unsupported of Number.default_format ];
}
val full_support : Number.number_support
val print_int_constant :
Number.number_support ->
Stdlib.Format.formatter -> Number.int_constant -> unit
val print_real_constant :
Number.number_support ->
Stdlib.Format.formatter -> Number.real_constant -> unit
val print_in_base :
int -> int option -> Stdlib.Format.formatter -> BigInt.t -> unit
val to_small_integer : Number.int_constant -> int
type int_range = { ir_lower : BigInt.t; ir_upper : BigInt.t; }
val create_range : BigInt.t -> BigInt.t -> Number.int_range
exception OutOfRange of Number.int_constant
val check_range : Number.int_constant -> Number.int_range -> unit
val int_range_equal : Number.int_range -> Number.int_range -> bool
type float_format = {
fp_exponent_digits : int;
fp_significand_digits : int;
}
exception NonRepresentableFloat of Number.real_constant
val compute_float :
Number.real_constant -> Number.float_format -> bool * BigInt.t * BigInt.t
val check_float : Number.real_constant -> Number.float_format -> unit
val float_format_equal : Number.float_format -> Number.float_format -> bool
end