You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library adds several functions useful for doing math on integers. Most of these are just gmp wrappers that may have more specialized versions for smaller integer types.
4
+
5
+
**Functions**
6
+
7
+
*`iroot(x::Integer, n::integer)` the integer nth root of `x`. Specifically, this is the largest integer `a` such that `a^n <= x`. Note that `n` must fit into an `Int64` (for GMP compatability).
8
+
*`ispower(x::Integer)` return if there are integer `base` and `exponent>1` values such that `base^exponent = x`.
9
+
*`find_exponent(x::Integer)` returns the largest possible integer `exponent` such that `base^exponent = x` for some `base`. Returns `1` for `x ∈ [0,1]`.
10
+
*`is_probably_prime(x::Integer; reps=25)` returns if `x` is prime. Will be incorrect less than `4^-reps` of the time.
0 commit comments