Skip to content

Commit 3e5279f

Browse files
authored
add Readme
1 parent 039c04b commit 3e5279f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
# IntegerMathUtils.jl
1+
# IntegerMathUtils.jl
2+
3+
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

Comments
 (0)