Module Core_kernel.Int64
This module extends Base.Int64.
Interface from Base
include module type of sig ... end
val of_float : float -> tval to_float : t -> floatval of_int_exn : int -> tval to_int_exn : t -> intval hash_fold_t : Base.Hash.state -> t -> Base.Hash.stateval hash : t -> Base.Hash.hash_valueval t_of_sexp : Base.Sexp.t -> tval sexp_of_t : t -> Base.Sexp.tval of_string : string -> tval to_string : t -> stringval (>=) : t -> t -> boolval (<=) : t -> t -> boolval (=) : t -> t -> boolval (>) : t -> t -> boolval (<) : t -> t -> boolval (<>) : t -> t -> boolval equal : t -> t -> boolval compare : t -> t -> intval min : t -> t -> tval max : t -> t -> tval ascending : t -> t -> intval descending : t -> t -> intval between : t -> low:t -> high:t -> boolval clamp_exn : t -> min:t -> max:t -> tval clamp : t -> min:t -> max:t -> t Base.Or_error.t
type comparator_witness= Base__Int64.comparator_witness
val comparator : (t, comparator_witness) Base.Comparator.comparatorval validate_lbound : min:t Base.Maybe_bound.t -> t Base.Validate.checkval validate_ubound : max:t Base.Maybe_bound.t -> t Base.Validate.checkval validate_bound : min:t Base.Maybe_bound.t -> max:t Base.Maybe_bound.t -> t Base.Validate.checkval pp : Base.Formatter.t -> t -> unitval validate_positive : t Base.Validate.checkval validate_non_negative : t Base.Validate.checkval validate_negative : t Base.Validate.checkval validate_non_positive : t Base.Validate.checkval is_positive : t -> boolval is_non_negative : t -> boolval is_negative : t -> boolval is_non_positive : t -> boolval sign : t -> Base__.Sign0.tval invariant : t Base__.Invariant_intf.inv
module Hex = Base__Int64.Hexval to_string_hum : ?delimiter:char -> t -> stringval zero : tval one : tval minus_one : tval (+) : t -> t -> tval (-) : t -> t -> tval (*) : t -> t -> tval (**) : t -> t -> tval neg : t -> tval (~-) : t -> tval (/%) : t -> t -> tval (%) : t -> t -> tval (/) : t -> t -> tval rem : t -> t -> tval (//) : t -> t -> floatval (land) : t -> t -> tval (lor) : t -> t -> tval (lxor) : t -> t -> tval (lnot) : t -> tval (lsl) : t -> int -> tval (asr) : t -> int -> tval round : ?dir:[ `Down | `Nearest | `Up | `Zero ] -> t -> to_multiple_of:t -> tval round_towards_zero : t -> to_multiple_of:t -> tval round_down : t -> to_multiple_of:t -> tval round_up : t -> to_multiple_of:t -> tval round_nearest : t -> to_multiple_of:t -> tval abs : t -> tval succ : t -> tval pred : t -> tval pow : t -> t -> tval bit_and : t -> t -> tval bit_or : t -> t -> tval bit_xor : t -> t -> tval bit_not : t -> tval popcount : t -> intval shift_left : t -> int -> tval shift_right : t -> int -> tval decr : t Base__.Import.ref -> unitval incr : t Base__.Import.ref -> unitval of_int32_exn : int32 -> tval to_int32_exn : t -> int32val of_int64_exn : int64 -> tval to_int64 : t -> int64val of_nativeint_exn : nativeint -> tval to_nativeint_exn : t -> nativeintval of_float_unchecked : float -> tval num_bits : intval max_value : tval min_value : tval (lsr) : t -> int -> tval shift_right_logical : t -> int -> tval ceil_pow2 : t -> tval floor_pow2 : t -> tval ceil_log2 : t -> intval floor_log2 : t -> intval is_pow2 : t -> bool
module O = Base__Int64.Oval of_int : int -> tval to_int : t -> int optionval of_int32 : int32 -> tval to_int32 : t -> int32 optionval of_nativeint : nativeint -> tval to_nativeint : t -> nativeint optionval of_int64 : t -> tval to_int_trunc : t -> intval to_int32_trunc : t -> int32val to_nativeint_trunc : t -> nativeintval bits_of_float : float -> tval float_of_bits : t -> float
Extensions
include Int_intf.Extension with type t := t and type comparator_witness := comparator_witness
include Bin_prot.Binable.S with type t := t
include Bin_prot.Binable.S_only_functions with type t := t
val bin_size_t : t Bin_prot.Size.sizerval bin_write_t : t Bin_prot.Write.writerval bin_read_t : t Bin_prot.Read.readerval __bin_read_t__ : (int -> t) Bin_prot.Read.readerThis function only needs implementation if
texposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the varianttafterwards.
val bin_shape_t : Bin_prot.Shape.tval bin_writer_t : t Bin_prot.Type_class.writerval bin_reader_t : t Bin_prot.Type_class.readerval bin_t : t Bin_prot.Type_class.t
include Typerep_lib.Typerepable.S with type t := t
val typerep_of_t : t Typerep_lib.Std_internal.Typerep.tval typename_of_t : t Typerep_lib.Typename.t
include Identifiable.S with type t := t
include Bin_prot.Binable.S with type t := t
include Bin_prot.Binable.S_only_functions with type t := t
val bin_size_t : t Bin_prot.Size.sizerval bin_write_t : t Bin_prot.Write.writerval bin_read_t : t Bin_prot.Read.readerval __bin_read_t__ : (int -> t) Bin_prot.Read.readerThis function only needs implementation if
texposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the varianttafterwards.
val bin_shape_t : Bin_prot.Shape.tval bin_writer_t : t Bin_prot.Type_class.writerval bin_reader_t : t Bin_prot.Type_class.readerval bin_t : t Bin_prot.Type_class.t
val hash_fold_t : Base.Hash.state -> t -> Base.Hash.stateval hash : t -> Base.Hash.hash_value
include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> tval sexp_of_t : t -> Sexplib0.Sexp.t
include Identifiable.S_common with type t := t
val compare : t -> t -> Core_kernel__.Import.intval hash_fold_t : Base.Hash.state -> t -> Base.Hash.stateval hash : t -> Base.Hash.hash_valueval sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
include Core_kernel__.Import.Stringable.S with type t := t
include Core_kernel__.Import.Pretty_printer.S with type t := t
val pp : Base.Formatter.t -> t -> unit
include Comparable.S_binable with type t := t
include Core_kernel__.Comparable_intf.S_common
include Base.Comparable.S
include Base__.Comparable_intf.Polymorphic_compare
val ascending : t -> t -> intascendingis identical tocompare.descending x y = ascending y x. These are intended to be mnemonic when used likeList.sort ~compare:ascendingandList.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.
val descending : t -> t -> intval between : t -> low:t -> high:t -> boolbetween t ~low ~highmeanslow <= t <= high
val clamp_exn : t -> min:t -> max:t -> tclamp_exn t ~min ~maxreturnst', the closest value totsuch thatbetween t' ~low:min ~high:maxis true.Raises if
not (min <= max).
val clamp : t -> min:t -> max:t -> t Base.Or_error.t
include Base.Comparator.S with type t := t
val comparator : (t, comparator_witness) Base.Comparator.comparator
include Base__.Comparable_intf.Validate with type t := t
val validate_lbound : min:t Base.Maybe_bound.t -> t Base.Validate.checkval validate_ubound : max:t Base.Maybe_bound.t -> t Base.Validate.checkval validate_bound : min:t Base.Maybe_bound.t -> max:t Base.Maybe_bound.t -> t Base.Validate.check
module Replace_polymorphic_compare : Core_kernel__.Comparable_intf.Polymorphic_compare with type t := tinclude Core_kernel__.Comparable_intf.Map_and_set_binable with type t := t with type comparator_witness := comparator_witness
include Comparator.S with type t := t
val comparator : (t, comparator_witness) Comparator.comparator
module Map : Map.S_binable with type Key.t = t with type Key.comparator_witness = comparator_witnessmodule Set : Set.S_binable with type Elt.t = t with type Elt.comparator_witness = comparator_witnessinclude Hashable.S_binable with type t := t
val hash_fold_t : Base.Hash.state -> t -> Base.Hash.stateval hash : t -> Base.Hash.hash_value
val hashable : t Hashtbl.Hashable.t
module Table : Hashtbl.S_binable with type key = tmodule Hash_set : Hash_set.S_binable with type elt = tmodule Hash_queue : Hash_queue.S with type key = tinclude Quickcheckable.S_int with type t := t
include Quickcheck_intf.S_range
include Quickcheck_intf.S
val quickcheck_generator : t Base_quickcheck.Generator.tval quickcheck_observer : t Base_quickcheck.Observer.tval quickcheck_shrinker : t Base_quickcheck.Shrinker.t
val gen_incl : t -> t -> t Base_quickcheck.Generator.tgen_incl lower_bound upper_boundproduces values betweenlower_boundandupper_bound, inclusive. It uses an ad hoc distribution that stresses boundary conditions more often than a uniform distribution, while still able to produce any value in the range. Raises iflower_bound > upper_bound.
val gen_uniform_incl : t -> t -> t Base_quickcheck.Generator.tgen_uniform_incl lower_bound upper_boundproduces a generator for values uniformly distributed betweenlower_boundandupper_bound, inclusive. Raises iflower_bound > upper_bound.
val gen_log_uniform_incl : t -> t -> t Base_quickcheck.Generator.tgen_log_uniform_incl lower_bound upper_boundproduces a generator for values betweenlower_boundandupper_bound, inclusive, where the number of bits used to represent the value is uniformly distributed. Raises if(lower_bound < 0) || (lower_bound > upper_bound).
val gen_log_incl : t -> t -> t Base_quickcheck.Generator.tgen_log_incl lower_bound upper_boundis likegen_log_uniform_incl, but weighted slightly more in favor of generatinglower_boundandupper_boundspecifically.