Index of values

( * ) [Q]

Multiplication mul.

( * ) [Z]

Multiplication mul.

( ** ) [Z]

Power pow.

(+) [Q]

Addition add.

(+) [Z]

Addition add.

(-) [Q]

Subtraction sub.

(-) [Z]

Subtraction sub.

(/) [Q]

Division div.

(/) [Z]

Truncated division div.

(//) [Q]

Creates a rational from two ints.

(///) [Q]

Creates a rational from two Z.t.

(/<) [Z]

Flooring division fdiv.

(/>) [Z]

Ceiling division cdiv.

(/|) [Z]

Exact division divexact.

(<) [Q]

Same as lt.

(<) [Z.Compare]

Same as lt.

(<=) [Q]

Same as leq.

(<=) [Z.Compare]

Same as leq.

(<>) [Q]

a <> b is equivalent to not (equal a b).

(<>) [Z.Compare]

a <> b is equivalent to not (equal a b).

(=) [Q]

Same as equal.

(=) [Z.Compare]

Same as equal.

(>) [Q]

Same as gt.

(>) [Z.Compare]

Same as gt.

(>=) [Q]

Same as geq.

(>=) [Z.Compare]

Same as geq.

(asr) [Q]

Division by a power of two shift_right.

(asr) [Z]

Bit-wise shift to the right shift_right.

(land) [Z]

Bit-wise logical and logand.

(lor) [Z]

Bit-wise logical inclusive or logor.

(lsl) [Q]

Multiplication by a power of two mul_2exp.

(lsl) [Z]

Bit-wise shift to the left shift_left.

(lxor) [Z]

Bit-wise logical exclusive or logxor.

(mod) [Z]

Remainder rem.

(~!) [Z]

Bit-wise logical negation lognot.

(~$$) [Q]

Conversion from Z.t.

(~$) [Q]

Conversion from int.

(~$) [Z]
(~+) [Q]

Identity.

(~+) [Z]

Identity.

(~-) [Q]

Negation neg.

(~-) [Z]

Negation neg.

A
abs [Q]

Absolute value.

abs [Z]

Absolute value.

abs_big_int [Big_int_Z]
add [Q]

Addition.

add [Z]

Addition.

add_big_int [Big_int_Z]
add_int_big_int [Big_int_Z]
and_big_int [Big_int_Z]
B
big_int_of_int [Big_int_Z]
big_int_of_int32 [Big_int_Z]
big_int_of_int64 [Big_int_Z]
big_int_of_nativeint [Big_int_Z]
big_int_of_string [Big_int_Z]
bin [Z]

bin n k returns the binomial coefficient n over k.

bprint [Q]

To be used as %a format printer in Printf.bprintf.

bprint [Z]

To be used as %a format printer in Printf.bprintf.

C
cdiv [Z]

Integer division with rounding towards +oo (ceiling).

classify [Q]

Determines the kind of a rational.

compare [Q]

compare x y compares x to y and returns 1 if x is strictly greater that y, -1 if it is strictly smaller, and 0 if they are equal.

compare [Z]

Comparison.

compare_big_int [Big_int_Z]
congruent [Z]

congruent a b c returns true if a is congruent to b modulo c.

D
den [Q]

Get the denominator.

div [Q]

Division.

div [Z]

Integer division.

div_2exp [Q]

div_2exp x n divides x by 2 to the power of n.

div_big_int [Big_int_Z]
div_rem [Z]

Computes both the integer quotient and the remainder.

divexact [Z]

divexact a b divides a by b, only producing correct result when the division is exact, i.e., when b evenly divides a.

divisible [Z]

divisible a b returns true if a is exactly divisible by b.

E
ediv [Z]

Euclidean division.

ediv_rem [Z]

Euclidean division and remainder.

eq_big_int [Big_int_Z]
equal [Q]

Equality testing.

equal [Z]

Equality test.

erem [Z]

Euclidean remainder.

extract [Z]

extract a off len returns a nonnegative number corresponding to bits off to off+len-1 of b.

extract_big_int [Big_int_Z]
F
fac [Z]

fac n returns the factorial of n (n!).

fac2 [Z]

fac2 n returns the double factorial of n (n!!).

facM [Z]

facM n m returns the m-th factorial of n.

fdiv [Z]

Integer division with rounding towards -oo (floor).

fib [Z]

fib n returns the n-th Fibonacci number.

fits_int [Z]

Whether the argument fits in a regular int.

fits_int32 [Z]

Whether the argument fits in an int32.

fits_int64 [Z]

Whether the argument fits in an int64.

fits_nativeint [Z]

Whether the argument fits in a nativeint.

float_of_big_int [Big_int_Z]
format [Z]

Gives a string representation of the argument in the specified printf-like format.

G
gcd [Z]

Greatest common divisor.

gcd_big_int [Big_int_Z]
gcdext [Z]

gcdext u v returns (g,s,t) where g is the greatest common divisor and g=us+vt.

ge_big_int [Big_int_Z]
geq [Q]

Greater than or equal.

geq [Z]

Greater than or equal.

gt [Q]

Greater than (not equal).

gt [Z]

Greater than (and not equal).

gt_big_int [Big_int_Z]
H
hamdist [Z]

Counts the number of different bits.

hash [Z]

Hashes a number, producing a small integer.

I
inf [Q]

1/0.

int32_of_big_int [Big_int_Z]
int64_of_big_int [Big_int_Z]
int_of_big_int [Big_int_Z]
inv [Q]

Inverse.

invert [Z]

invert base mod returns the inverse of base modulo mod.

is_even [Z]

Returns true if the argument is even (divisible by 2), false if odd.

is_int_big_int [Big_int_Z]
is_odd [Z]

Returns true if the argument is odd, false if even.

is_real [Q]

Whether the argument is non-infinity and non-undefined.

J
jacobi [Z]

jacobi a b returns the Jacobi symbol (a/b).

K
kronecker [Z]

kronecker a b returns the Kronecker symbol (a/b).

L
lcm [Z]

Least common multiple.

le_big_int [Big_int_Z]
legendre [Z]

legendre a b returns the Legendre symbol (a/b).

leq [Q]

Less than or equal.

leq [Z]

Less than or equal.

log2 [Z]

Returns the base-2 logarithm of its argument, rounded down to an integer.

log2up [Z]

Returns the base-2 logarithm of its argument, rounded up to an integer.

logand [Z]

Bitwise logical and.

lognot [Z]

Bitwise logical negation.

logor [Z]

Bitwise logical or.

logxor [Z]

Bitwise logical exclusive or.

lt [Q]

Less than (not equal).

lt [Z]

Less than (and not equal).

lt_big_int [Big_int_Z]
lucnum [Z]

lucnum n returns the n-th Lucas number.

M
make [Q]

make num den constructs a new rational equal to num/den.

max [Q]

Returns the largest of its arguments.

max [Z]

Returns the maximum of its arguments.

max_big_int [Big_int_Z]
min [Q]

Returns the smallest of its arguments.

min [Z]

Returns the minimum of its arguments.

min_big_int [Big_int_Z]
minus_big_int [Big_int_Z]
minus_inf [Q]

-1/0.

minus_one [Q]

0, 1, -1.

minus_one [Z]

The number -1.

mod_big_int [Big_int_Z]
mul [Q]

Multiplication.

mul [Z]

Multiplication.

mul_2exp [Q]

mul_2exp x n multiplies x by 2 to the power of n.

mult_big_int [Big_int_Z]
mult_int_big_int [Big_int_Z]
N
nativeint_of_big_int [Big_int_Z]
neg [Q]

Negation.

neg [Z]

Unary negation.

nextprime [Z]

Returns the next prime greater than the argument.

num [Q]

Get the numerator.

num_digits_big_int [Big_int_Z]
numbits [Z]

Returns the number of significant bits in the given number.

O
of_bigint [Q]
of_bits [Z]

Constructs a number from a binary string representation.

of_float [Q]

Conversion from a float.

of_float [Z]

Converts from a floating-point value.

of_int [Q]
of_int [Z]

Converts from a base integer.

of_int32 [Q]
of_int32 [Z]

Converts from a 32-bit integer.

of_int64 [Q]
of_int64 [Z]

Converts from a 64-bit integer.

of_ints [Q]

Conversion from an int numerator and an int denominator.

of_nativeint [Q]

Conversions from various integer types.

of_nativeint [Z]

Converts from a native integer.

of_string [Q]

Converts a string to a rational.

of_string [Z]

Converts a string to an integer.

of_string_base [Z]

Parses a number represented as a string in the specified base, with optional - or + prefix.

of_substring [Z]

of_substring s ~pos ~len is the same as of_string (String.sub s pos len)

of_substring_base [Z]

of_substring_base base s ~pos ~len is the same as of_string_base base (String.sub s pos len)

one [Q]
one [Z]

The number 1.

or_big_int [Big_int_Z]
output [Q]

Prints the argument on the specified channel.

output [Z]

Prints the argument on the specified channel.

P
perfect_power [Z]

True if the argument has the form a^b, with b>1

perfect_square [Z]

True if the argument has the form a^2.

popcount [Z]

Counts the number of bits set.

pow [Z]

pow base exp raises base to the exp power.

power [Big_int_Z]
power_big [Big_int_Z]
power_big_int_positive_big_int [Big_int_Z]
power_big_int_positive_int [Big_int_Z]
power_int_positive_big_int [Big_int_Z]
power_int_positive_int [Big_int_Z]
powm [Z]

powm base exp mod computes base^exp modulo mod.

powm_sec [Z]

powm_sec base exp mod computes base^exp modulo mod.

pp_print [Q]

Prints the argument on the specified formatter.

pp_print [Z]

Prints the argument on the specified formatter.

pred [Z]

Returns its argument minus one.

pred_big_int [Big_int_Z]
primorial [Z]

primorial n returns the product of all positive prime numbers less than or equal to n.

print [Q]

Prints the argument on the standard output.

print [Z]

Prints the argument on the standard output.

probab_prime [Z]

probab_prime x r returns 0 if x is definitely composite, 1 if x is probably prime, and 2 if x is definitely prime.

Q
quomod_big_int [Big_int_Z]
R
rem [Z]

Integer remainder.

remove [Z]

remove a b returns a after removing all the occurences of the factor b.

root [Z]

root x n computes the n-th root of x.

rootrem [Z]

rootrem x n computes the n-th root of x and the remainder x-root**n.

S
shift_left [Z]

Shifts to the left.

shift_left_big_int [Big_int_Z]
shift_right [Z]

Shifts to the right.

shift_right_big_int [Big_int_Z]
shift_right_towards_zero_big_int [Big_int_Z]
shift_right_trunc [Z]

Shifts to the right, rounding towards 0.

sign [Q]

Returns 1 if the argument is positive (including inf), -1 if it is negative (including -inf), and 0 if it is null or undefined.

sign [Z]

Returns -1, 0, or 1 when the argument is respectively negative, null, or positive.

sign_big_int [Big_int_Z]
signed_extract [Z]

signed_extract a off len extracts bits off to off+len-1 of b, as extract does, then sign-extends bit len-1 of the result (that is, bit off + len - 1 of a).

size [Z]

Returns the number of machine words used to represent the number.

sprint [Q]

To be used as %a format printer in Printf.sprintf.

sprint [Z]

To be used as %a format printer in Printf.sprintf.

sqrt [Z]

Returns the square root.

sqrt_big_int [Big_int_Z]
sqrt_rem [Z]

Returns the square root truncated, and the remainder.

square_big_int [Big_int_Z]
string_of_big_int [Big_int_Z]
sub [Q]

Subtraction.

sub [Z]

Subtraction.

sub_big_int [Big_int_Z]
succ [Z]

Returns its argument plus one.

succ_big_int [Big_int_Z]
T
testbit [Z]

testbit x n return the value of bit number n in x: true if the bit is 1, false if the bit is 0.

to_bigint [Q]
to_bits [Z]

Returns a binary representation of the argument.

to_float [Q]

Converts to a floating-point number, using the current floating-point rounding mode.

to_float [Z]

Converts to a floating-point value.

to_int [Q]
to_int [Z]

Converts to a base integer.

to_int32 [Q]
to_int32 [Z]

Converts to a 32-bit integer.

to_int64 [Q]
to_int64 [Z]

Converts to a 64-bit integer.

to_nativeint [Q]

Convert to integer by truncation.

to_nativeint [Z]

Converts to a native integer.

to_string [Q]

Converts to human-readable, base-10, /-separated rational.

to_string [Z]

Gives a human-readable, decimal string representation of the argument.

trailing_zeros [Z]

Returns the number of trailing 0 bits in the given number.

U
undef [Q]

0/0.

unit_big_int [Big_int_Z]
V
version [Z]

Library version.

X
xor_big_int [Big_int_Z]
Z
zero [Q]
zero [Z]

The number 0.

zero_big_int [Big_int_Z]