This library adds several functions useful for doing math on integers. Most of these are GMP wrappers that may have faster implimentations for smaller integer types.
iroot(x::Integer, n::integer)the integer nth root of
x. Specifically, this is the largest integer
a^n <= x. Note that
nmust fit into an
Int64(for GMP compatability).
ispower(x::Integer)return if there are integer
exponent>1values such that
base^exponent = x.
find_exponent(x::Integer)returns the largest possible integer
base^exponent = xfor some
x ∈ [0,1].
is_probably_prime(x::Integer; reps=25)returns if
xis prime. Will be incorrect less than
4^-repsof the time.