DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK

# (gmp.info.gz) Integer Roots Info Catalog (gmp.info.gz) Integer Exponentiation (gmp.info.gz) Integer Functions (gmp.info.gz) Number Theoretic Functions
```
Root Extraction Functions
=========================

- Function: int mpz_root (mpz_t ROP, mpz_t OP, unsigned long int N)
Set ROP to  the truncated integer part of the Nth root of OP.
Return non-zero if the computation was exact, i.e., if OP is ROP
to the Nth power.

- Function: void mpz_rootrem (mpz_t ROOT, mpz_t REM, mpz_t U, unsigned
long int N)
Set ROOT to  the truncated integer part of the Nth root of U.  Set
REM to the remainder, U-ROOT**N.

- Function: void mpz_sqrt (mpz_t ROP, mpz_t OP)
Set ROP to  the truncated integer part of the square root of OP.

- Function: void mpz_sqrtrem (mpz_t ROP1, mpz_t ROP2, mpz_t OP)
Set ROP1 to the truncated integer part of the square root of OP,
like `mpz_sqrt'.  Set ROP2 to the remainder OP-ROP1*ROP1, which
will be zero if OP is a perfect square.

If ROP1 and ROP2 are the same variable, the results are undefined.

- Function: int mpz_perfect_power_p (mpz_t OP)
Return non-zero if OP is a perfect power, i.e., if there exist
integers A and B, with B>1, such that OP equals A raised to the
power B.

Under this definition both 0 and 1 are considered to be perfect
powers.  Negative values of OP are accepted, but of course can
only be odd perfect powers.

- Function: int mpz_perfect_square_p (mpz_t OP)
Return non-zero if OP is a perfect square, i.e., if the square
root of OP is an integer.  Under this definition both 0 and 1 are
considered to be perfect squares.

``` Info Catalog (gmp.info.gz) Integer Exponentiation (gmp.info.gz) Integer Functions (gmp.info.gz) Number Theoretic Functions
automatically generated byinfo2html