module BatInt:Operations on integers.sig..end
This module provides operations on the type int of
integers. Values of this type may be either 31 bits on 32-bit
processors or 63 bits on 64-bit processors. All arithmetic
operations over int are taken modulo 2number of bits.
This module implements Number.Numeric,
Number.Bounded, Number.Discrete.
Author(s): Gabriel Scherer, David Teller
typet =int
val zero : int0.val one : int1.val minus_one : int-1.val neg : int -> intval add : int -> int -> intval (+) : int -> int -> intval sub : int -> int -> intval (-) : int -> int -> intval mul : int -> int -> intval ( * ) : int -> int -> intval div : int -> int -> intDivision_by_zero if the second
argument is zero. This division rounds the real quotient of
its arguments towards zero, as specified for Pervasives.(/).val (/) : int -> int -> intDivision_by_zero if the second
argument is zero. This division rounds the real quotient of
its arguments towards zero, as specified for Pervasives.(/).val rem : int -> int -> inty is not zero, the result
of Int.rem x y satisfies the following property:
x = Int.add (Int.mul (Int.div x y) y) (Int.rem x y).
If y = 0, Int.rem x y raises Division_by_zero.val modulo : int -> int -> intmodulo a b computes the remainder of the integer
division of a by b. This is defined only if b <> 0.
The result of modulo a b is a number m between
0 and abs ( b - 1 ) if a >= 0 or between ~- ( abs ( b - 1 ) )
if a < 0 and such that a * k + (abs b) = m,
for some k.
val pow : int -> int -> intpow a b computes abval ( ** ) : int -> int -> inta ** b computes abval (<>) : int -> int -> boolval (>) : int -> int -> boolval (<) : int -> int -> boolval (>=) : int -> int -> boolval (<=) : int -> int -> boolval (=) : int -> int -> boolval min_num : intval max_num : intval succ : int -> intInt.succ x is Int.add x Int.one.val pred : int -> intInt.pred x is Int.sub x Int.one.val abs : int -> intval of_float : float -> intInt.min_int, Int.max_int].val to_float : int -> floatval of_string : string -> int0x, 0o or 0b
respectively.
Raise Invalid_argument "int_of_string" if the given string is not
a valid representation of an integer, or if the integer represented
exceeds the range of integers representable in type int.val to_string : int -> stringval compare : t -> t -> intPervasives.compare. Along with the type t, this function compare
allows the module Int to be passed as argument to the functors
Set.Make and Map.Make.val operations : int BatNumber.numericval (--) : t -> t -> t BatEnum.t
5 -- 10 is the enumeration 5,6,7,8,9,10.
10 -- 5 is the empty enumeration
val (---) : t -> t -> t BatEnum.t
5 -- 10 is the enumeration 5,6,7,8,9,10.
10 -- 5 is the enumeration 10,9,8,7,6,5.
val of_int : int -> intval to_int : int -> intval print : 'a BatInnerIO.output -> int -> unitval xprint : 'a BatInnerIO.output -> int -> unitval t_printer : t BatValue_printer.tmodule Safe_int:sig..end