package solidity-common

  1. Overview
  2. Docs
include module type of Q with type t = Q.t
type t = Q.t = {
  1. num : Z.t;
  2. den : Z.t;
}
val make : Z.t -> Z.t -> t
val zero : t
val one : t
val minus_one : t
val inf : t
val minus_inf : t
val undef : t
val of_bigint : Z.t -> t
val of_int : int -> t
val of_int32 : int32 -> t
val of_int64 : int64 -> t
val of_nativeint : nativeint -> t
val of_ints : int -> int -> t
val of_float : float -> t
val of_string : string -> t
val num : t -> Z.t
val den : t -> Z.t
type kind =
  1. | ZERO
  2. | INF
  3. | MINF
  4. | UNDEF
  5. | NZERO
val classify : t -> kind
val is_real : t -> bool
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val min : t -> t -> t
val max : t -> t -> t
val leq : t -> t -> bool
val geq : t -> t -> bool
val lt : t -> t -> bool
val gt : t -> t -> bool
val to_bigint : t -> Z.t
val to_int : t -> int
val to_int32 : t -> int32
val to_int64 : t -> int64
val to_nativeint : t -> nativeint
val to_string : t -> string
val to_float : t -> float
val neg : t -> t
val abs : t -> t
val add : t -> t -> t
val sub : t -> t -> t
val mul : t -> t -> t
val inv : t -> t
val div : t -> t -> t
val mul_2exp : t -> int -> t
val div_2exp : t -> int -> t
val print : t -> unit
val output : Stdlib.out_channel -> t -> unit
val sprint : unit -> t -> string
val bprint : Stdlib.Buffer.t -> t -> unit
val pp_print : Stdlib.Format.formatter -> t -> unit
val (~-) : t -> t
val (~+) : t -> t
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (/) : t -> t -> t
val (lsl) : t -> int -> t
val (asr) : t -> int -> t
val (~$) : int -> t
val (//) : int -> int -> t
val (~$$) : Z.t -> t
val (///) : Z.t -> Z.t -> t
val (=) : t -> t -> bool
val (<) : t -> t -> bool
val (>) : t -> t -> bool
val (<=) : t -> t -> bool
val (>=) : t -> t -> bool
val (<>) : t -> t -> bool
val is_int : Q.t -> bool
val is_neg : Q.t -> bool
val is_pos : Q.t -> bool
val to_fixed_with_dec : int -> Q.t -> Z.t
val to_fixed : Q.t -> Z.t * int
OCaml

Innovation. Community. Security.