| |
- factor_prime_power(x)
- Return p and d for a prime power x = p**d.
- gcdext(...)
- gcdext(a, b) - > tuple
Return a 3-element tuple (g,s,t) such that
g == gcd(a,b) and g == a*s + b*t
- invert(...)
- invert(x, m) -> mpz
Return y such that x*y == 1 modulo m. Raises ZeroDivisionError if no
inverse exists.
- iroot(...)
- iroot(x,n) -> (number, boolean)
Return the integer n-th root of x and boolean value that is True
iff the root is exact. x >= 0. n > 0.
- is_prime(...)
- is_prime(x[, n=25]) -> bool
Return True if x is _probably_ prime, else False if x is
definitely composite. x is checked for small divisors and up
to n Miller-Rabin tests are performed.
- is_square(...)
- is_square(x) -> bool
Returns True if x is a perfect square, else return False.
- isqrt(...)
- isqrt(x) -> mpz
Return the integer square root of an integer x. x >= 0.
- jacobi(...)
- jacobi(x, y) -> mpz
Return the Jacobi symbol (x|y). y must be odd and >0.
- kronecker(...)
- kronecker(x, y) -> mpz
Return the Kronecker-Jacobi symbol (x|y).
- legendre(...)
- legendre(x, y) -> mpz
Return the Legendre symbol (x|y). y is assumed to be an odd prime.
- next_prime(...)
- next_prime(x) -> mpz
Return the next _probable_ prime number > x.
- powmod(...)
- powmod(x, y, m) -> mpz
Return (x**y) mod m. Same as the three argument version of Python's
built-in pow(), but converts all three arguments to mpz.
- prev_prime(x)
- Return the greatest probable prime number < x, if any.
- ratrec(x, y, N=None, D=None)
- Return rational reconstruction (n, d) of x modulo y.
That is, n/d = x (mod y) with -N <= n <= N and 0 < d <= D,
provided 2*N*D < y.
Default N=D=None will set both N and D to sqrt(y/2) approximately.
- version(...)
- version() -> string
Return string giving current GMPY2 version.
|