Module Int_lit.Util

Some Utils for arith

type divisor = {
prime : Z.t;
power : int;
}
val is_prime : Z.t -> bool

Is the integer prime?

val prime_decomposition : Z.t -> divisor list

Decompose the number into a product of power-of-primes. Cheap if is_prime n was called before.

raises Invalid_argument

if the number is negative

val primes_leq : Z.t -> Z.t Iter.t

Iter of prime numbers smaller than (or equal to) the given number