CCIntBasic Int functions
val zero : tzero is the integer 0.
val one : tone is the integer 1.
val minus_one : tminus_one is the integer -1.
val max_int : tmax_int is the maximum integer.
val min_int : tmin_int is the minimum integer.
compare x y is the comparison function for integers with the same specification as Stdlib.compare.
val hash : t -> inthash x computes the hash of x.
val sign : t -> intsign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x 0.
pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.
floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.
val random : int -> t random_genval random_small : t random_genval random_range : int -> int -> t random_genval to_float : t -> floatto_float is the same as float_of_int
val to_string : t -> stringto_string x returns the string representation of the integer x, in signed decimal.
val of_string : string -> t optionof_string s converts the given string s into an integer. Safe version of of_string_exn.
val of_string_exn : string -> tof_string_exn s converts the given string s to an integer. Alias to int_of_string.
val of_float : float -> tof_float x converts the given floating-point number x to an integer. Alias to int_of_float.
val to_string_binary : t -> stringto_string_binary x returns the string representation of the integer x, in binary.
range_by ~step i j iterates on integers from i to j included, where the difference between successive elements is step. Use a negative step for a decreasing list.
range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.
range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].
val popcount : t -> intNumber of bits set to 1
module Infix : sig ... endinclude module type of Infix