-
containers
-
containers.data
-
containers.monomorphic
-
containers.sexp
-
containers.top
Library
Module
Module type
Parameter
Class
Class type
Basic Int functions
The comparison function for integers with the same specification as Pervasives.compare
.
val hash : t -> int
val sign : t -> int
sign i
is one of -1, 0, 1
.
pow base exponent
returns base
raised to the power of exponent
. pow a b = a^b
for positive integers a
and b
. Raises Invalid_argument
if a = b = 0
or b
< 0.
- since 0.11
floor_div a n
is integer division rounding towards negative infinity. It satisfies a = m * floor_div a n + rem a n
.
- since 1.2
type 'a printer = Format.formatter -> 'a -> unit
type 'a random_gen = Random.State.t -> 'a
val random : int -> t random_gen
val random_small : t random_gen
val random_range : int -> int -> t random_gen
val to_string : t -> string
Return the string representation of its argument, in signed decimal.
- since 0.13
val of_string : string -> t option
- since 0.13
val to_string_binary : t -> string
- since 0.20
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.
- raises Invalid_argument
if
step=0
.
- since 1.2
range i j
iterates on integers from i
to j
included . It works both for decreasing and increasing ranges.
- since 1.2
Like range
but the second bound is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4]
.
- since 1.2
Infix Operators
- since 0.17
module Infix : sig ... end