Module type Int_intf.S

module type S = sig .. end

type t 
val typerep_of_t : t Typerep_lib.Std.Typerep.t
val typename_of_t : t Typerep_lib.Std.Typename.t
include Floatable
include Intable
include Identifiable
include Comparable.With_zero
include Int_intf.Hexable
val to_string_hum : ?delimiter:char -> t -> string
delimiter is underscore by default
val num_bits : int
The number of bits available in this integer type. Note that the integer representations are signed

Infix operators and constants

val zero : t
val one : t
val minus_one : t
val (+) : t -> t -> t
val (-) : t -> t -> t
val ( * ) : t -> t -> t
val neg : t -> t
Negation
val (~-) : t -> t
val (/%) : t -> t -> t
There are two pairs of integer division and remainder functions, /% and %, and / and rem. They both satisfy the same equation relating the quotient and the remainder:

        x = (x /% y) * y + (x % y);
        x = (x /  y) * y + (rem x y);
      

The functions return the same values if x and y are positive. They all raise if y = 0.

The functions differ if x < 0 or y < 0.

If y < 0, then % and /% raise, whereas / and rem do not.

x % y always returns a value between 0 and y - 1, even when x < 0. On the other hand, rem x y returns a negative value if and only if x < 0; that value satisfies abs (rem x y) <= abs y - 1.

val (%) : t -> t -> t
val (/) : t -> t -> t
val rem : t -> t -> t
val (//) : t -> t -> float
float division of integers
module O: sig .. end
A sub-module designed to be opened to make working with ints more convenient.

Successor and predecessor functions

val succ : t -> t
val pred : t -> t
val abs : t -> t
Returns the absolute value of the argument. May be negative if the input is min_value
include Int_intf.Round
val pow : t -> t -> t
pow base exponent returns base raised to the power of exponent. It is OK if base <= 0. pow raises if exponent < 0, or an integer overflow would occur.
val max_value : t
The largest representable integer

The smallest representable integer

val min_value : t

Bit-wise logical operations

val bit_and : t -> t -> t
val bit_or : t -> t -> t
val bit_xor : t -> t -> t
val bit_not : t -> t

Bit-shifting operations

The results are unspecified for negative shifts and shifts >= num_bits

val shift_left : t -> int -> t
shifts left, filling in with zeroes

shifts right, preserving the sign of the input.

val shift_right : t -> int -> t
shifts right, filling in with zeroes, which will not preserve the sign of the input
val shift_right_logical : t -> int -> t

Increment and decrement functions for integer references

val decr : t Pervasives.ref -> unit
val incr : t Pervasives.ref -> unit

Conversion functions to related integer types

val of_int32_exn : int32 -> t
val to_int32_exn : t -> int32
val of_int64_exn : int64 -> t
val to_int64 : t -> int64
val of_nativeint_exn : nativeint -> t
val to_nativeint_exn : t -> nativeint
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val bin_t : t Bin_prot.Type_class.t
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (int -> t) Bin_prot.Read.reader
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_writer_t : t Bin_prot.Type_class.writer

delimiter is underscore by default

The number of bits available in this integer type. Note that the integer representations are signed

Infix operators and constants


Negation

There are two pairs of integer division and remainder functions, /% and %, and / and rem. They both satisfy the same equation relating the quotient and the remainder:

        x = (x /% y) * y + (x % y);
        x = (x /  y) * y + (rem x y);
      

The functions return the same values if x and y are positive. They all raise if y = 0.

The functions differ if x < 0 or y < 0.

If y < 0, then % and /% raise, whereas / and rem do not.

x % y always returns a value between 0 and y - 1, even when x < 0. On the other hand, rem x y returns a negative value if and only if x < 0; that value satisfies abs (rem x y) <= abs y - 1.

float division of integers

A sub-module designed to be opened to make working with ints more convenient.

Successor and predecessor functions


Returns the absolute value of the argument. May be negative if the input is min_value

pow base exponent returns base raised to the power of exponent. It is OK if base <= 0. pow raises if exponent < 0, or an integer overflow would occur.

The largest representable integer

The smallest representable integer

Bit-wise logical operations


Bit-shifting operations

The results are unspecified for negative shifts and shifts >= num_bits

shifts left, filling in with zeroes

shifts right, preserving the sign of the input.

shifts right, filling in with zeroes, which will not preserve the sign of the input

Increment and decrement functions for integer references


Conversion functions to related integer types