---
title: "Element Operations"
canonical: "https://docs.magma-maths.org/v2.30-1/BasicRings/Integers/operation-element.html"
source: "https://docs.magma-maths.org/v2.30-1/BasicRings/Integers/operation-element.md"
part: "Basic Rings"
chapter: "Ring of Integers"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Basic Rings", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/index-basic-rings.md"}
  - {"title": "Ring of Integers", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/Integers/index-integers.md"}
prev: {"title": "Structure Operations", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/Integers/operation.md"}
next: {"title": "Random Numbers", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/Integers/random.md"}
intrinsics:
  - {"name": "+", "signature": "+ n: RngIntElt -> RngIntElt"}
  - {"name": "-", "signature": "- n: RngIntElt -> RngIntElt"}
  - {"name": "+", "signature": "m + n: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "-", "signature": "m - n: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "*", "signature": "m * n: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "^", "signature": "n ^ k: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "/", "signature": "m / n: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "+:=", "signature": "m +:= n: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "-:=", "signature": "m -:= n: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "*:=", "signature": "m *:= n: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "/:=", "signature": "m /:= n: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "^:=", "signature": "m ^:= k: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "div", "signature": "n div m: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "mod", "signature": "n mod m: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "ExactQuotient", "signature": "ExactQuotient(n, d): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "div:=", "signature": "n div:= m: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "mod:=", "signature": "n mod:= m: RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "ShiftLeft", "signature": "ShiftLeft(n, b): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "ShiftRight", "signature": "ShiftRight(n, b): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "ModByPowerOf2", "signature": "ModByPowerOf2(n, b): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "BitwiseNot", "signature": "BitwiseNot(x): RngIntElt -> RngIntElt"}
  - {"name": "BitwiseAnd", "signature": "BitwiseAnd(x, y): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "BitwiseOr", "signature": "BitwiseOr(x, y): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "BitwiseXor", "signature": "BitwiseXor(x, y): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "eq", "signature": "m eq n: RngIntElt, RngIntElt -> BoolElt"}
  - {"name": "ne", "signature": "m ne n: RngIntElt, RngIntElt -> BoolElt"}
  - {"name": "in", "signature": "n in R: RngIntElt, Rng -> BoolElt"}
  - {"name": "notin", "signature": "n notin R: RngIntElt, Rng -> BoolElt"}
  - {"name": "Parent", "signature": "Parent(n): RngIntElt -> RngInt"}
  - {"name": "Category", "signature": "Category(n): RngIntElt -> Cat"}
  - {"name": "IsEven", "signature": "IsEven(n): RngIntElt -> BoolElt"}
  - {"name": "IsOdd", "signature": "IsOdd(n): RngIntElt -> BoolElt"}
  - {"name": "IsDivisibleBy", "signature": "IsDivisibleBy(n, d): RngIntElt, RngIntElt -> BoolElt, RngIntElt"}
  - {"name": "IsSquare", "signature": "IsSquare(n): RngIntElt -> BoolElt, RngIntElt"}
  - {"name": "IsSquarefree", "signature": "IsSquarefree(n): RngIntElt -> BoolElt"}
  - {"name": "IsPower", "signature": "IsPower(n): RngIntElt -> BoolElt"}
  - {"name": "IsPower", "signature": "IsPower(n, k): RngIntElt, RngIntElt -> BoolElt"}
  - {"name": "IsPrime", "signature": "IsPrime(n): RngIntElt -> BoolElt"}
  - {"name": "IsIntegral", "signature": "IsIntegral(n): RngIntElt -> BoolElt"}
  - {"name": "IsSinglePrecision", "signature": "IsSinglePrecision(n): RngIntElt -> BoolElt"}
  - {"name": "IsZero", "signature": "IsZero(n): RngIntElt -> BoolElt"}
  - {"name": "IsOne", "signature": "IsOne(n): RngIntElt -> BoolElt"}
  - {"name": "IsMinusOne", "signature": "IsMinusOne(n): RngIntElt -> BoolElt"}
  - {"name": "IsNilpotent", "signature": "IsNilpotent(n): RngIntElt -> BoolElt"}
  - {"name": "IsIdempotent", "signature": "IsIdempotent(n): RngIntElt -> BoolElt"}
  - {"name": "IsUnit", "signature": "IsUnit(n): RngIntElt -> BoolElt"}
  - {"name": "IsZeroDivisor", "signature": "IsZeroDivisor(n): RngIntElt -> BoolElt"}
  - {"name": "IsRegular", "signature": "IsRegular(n): RngInt -> BoolElt"}
  - {"name": "IsIrreducible", "signature": "IsIrreducible(n): RngIntElt -> BoolElt"}
  - {"name": "IsPrime", "signature": "IsPrime(n): RngIntElt -> BoolElt"}
  - {"name": "gt", "signature": "m gt n: RngIntElt, RngIntElt -> BoolElt"}
  - {"name": "ge", "signature": "m ge n: RngIntElt, RngIntElt -> BoolElt"}
  - {"name": "lt", "signature": "m lt n: RngIntElt, RngIntElt -> BoolElt"}
  - {"name": "le", "signature": "m le n: RngIntElt, RngIntElt -> BoolElt"}
  - {"name": "Maximum", "signature": "Maximum(m, n): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "Maximum", "signature": "Maximum(Q): [RngIntElt] -> RngIntElt"}
  - {"name": "Minimum", "signature": "Minimum(m, n): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "Minimum", "signature": "Minimum(Q): [RngIntElt] -> RngIntElt"}
  - {"name": "ComplexConjugate", "signature": "ComplexConjugate(n): RngIntElt -> RngIntElt"}
  - {"name": "Conjugate", "signature": "Conjugate(n): RngIntElt -> RngIntElt"}
  - {"name": "Norm", "signature": "Norm(n): RngIntElt -> RngIntElt"}
  - {"name": "EuclideanNorm", "signature": "EuclideanNorm(n): RngIntElt -> RngIntElt"}
  - {"name": "Trace", "signature": "Trace(n): RngIntElt -> RngIntElt"}
  - {"name": "MinimalPolynomial", "signature": "MinimalPolynomial(n): RngIntElt -> RngUPolElt"}
  - {"name": "AbsoluteValue", "signature": "AbsoluteValue(n): RngIntElt -> RngIntElt"}
  - {"name": "Abs", "signature": "Abs(n): RngIntElt -> RngIntElt"}
  - {"name": "Ilog2", "signature": "Ilog2(n): RngIntElt -> RngIntElt"}
  - {"name": "Ilog", "signature": "Ilog(b, n): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "Quotrem", "signature": "Quotrem(m, n): RngIntElt, RngIntElt -> RngIntElt, RngIntElt"}
  - {"name": "Valuation", "signature": "Valuation(x, p): RngIntElt, RngIntElt -> RngIntElt, RngIntElt"}
  - {"name": "Iroot", "signature": "Iroot(a, n): RngIntElt, RngIntElt -> RngIntElt"}
  - {"name": "Sign", "signature": "Sign(n): RngIntElt -> RngIntElt"}
  - {"name": "Ceiling", "signature": "Ceiling(n): RngIntElt -> RngIntElt"}
  - {"name": "Floor", "signature": "Floor(n): RngIntElt -> RngIntElt"}
  - {"name": "Round", "signature": "Round(n): RngIntElt -> RngIntElt"}
  - {"name": "Truncate", "signature": "Truncate(n): RngIntElt -> RngIntElt"}
  - {"name": "SquarefreeFactorization", "signature": "SquarefreeFactorization(n): RngIntElt -> RngIntElt, RngIntElt"}
  - {"name": "Isqrt", "signature": "Isqrt(n): RngIntElt -> RngIntElt"}
examples:
  - "ex-687a13"
---

# Element Operations

## Arithmetic Operations

Magma includes both the Karatsuba algorithm and the Schönhage-Strassen FFT-based algorithm for the multiplication of integers ([[AHU74](https://docs.magma-maths.org/v2.30-1/references.md#cite-ahohopcroftullman), Chap. 7], [[vzGG99](https://docs.magma-maths.org/v2.30-1/references.md#cite-gathengerhard), Sec. 8.3]). The crossover point (where the FFT method beats the Karatsuba method) is currently $2^{15}$ bits (approx. 10000 decimal digits) on Sun SPARC workstations and $2^{17}$ bits (approx. 40000 decimal digits) on Digital Alpha workstations. Assembler macros are used for critical operations and 64-bit operations are used on DEC-Alpha machines.

Magma also contains an asymptotically-fast integer (and polynomial) division algorithm which reduces division to multiplication with a constant scale factor that is in the practical range. Thus division of integers and polynomials are based on the Karatsuba and Schönhage-Strassen (FFT) methods when applicable. The crossover point for integer division (when the new method outperforms the classical method) is currently at the point of dividing a $2^{12}$ bit (approx. 1200 decimal digit) integer by a $2^{11}$ (approx. 600 decimal digit) integer on Sun SPARC workstations.

<a id="operation-operation-rngintelt-rngintelt"></a>
### `+ n: RngIntElt -> RngIntElt`

<a id="operation-operation-rngintelt-rngintelt-2"></a>
### `- n: RngIntElt -> RngIntElt`

<a id="operation-op-plus-rngintelt-rngintelt"></a>
### `m + n: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-op-minus-rngintelt-rngintelt"></a>
### `m - n: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-op-times-rngintelt-rngintelt"></a>
### `m * n: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-op-pow-rngintelt-rngintelt"></a>
### `n ^ k: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-op-div-rngintelt-rngintelt"></a>
### `m / n: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-operation-rngintelt-rngintelt-rngintelt"></a>
### `m +:= n: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-operation-rngintelt-rngintelt-rngintelt-2"></a>
### `m -:= n: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-operation-rngintelt-rngintelt-rngintelt-3"></a>
### `m *:= n: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-operation-rngintelt-rngintelt-rngintelt-4"></a>
### `m /:= n: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-operation-rngintelt-rngintelt-rngintelt-5"></a>
### `m ^:= k: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-operation-div-rngintelt-rngintelt-rngintelt"></a>
### `n div m: RngIntElt, RngIntElt -> RngIntElt`

The quotient $q$ of the division with remainder $n=qm+r$, where $0\leq r<m$ or $m<r\leq 0$ (depending on the sign of $m$), for integers $n$ and $m\neq 0$.

<a id="operation-operation-mod-rngintelt-rngintelt-rngintelt"></a>
### `n mod m: RngIntElt, RngIntElt -> RngIntElt`

The remainder $r$ of the division with remainder $n=qm+r$, where $0\leq r<m$ or $m<r\leq 0$ (depending on the sign of $m$), for integers $n$ and $m\neq 0$.

<a id="function-exactquotient-rngintelt-rngintelt"></a>
### `ExactQuotient(n, d): RngIntElt, RngIntElt -> RngIntElt`

Assuming that the integer $n$ is exactly divisible by the integer $d$, return the exact quotient of $n$ by $d$ (as an integer). An error results if $d$ does not divide $n$ exactly.

<a id="operation-operation-div-rngintelt-rngintelt-rngintelt-2"></a>
### `n div:= m: RngIntElt, RngIntElt -> RngIntElt`

<a id="operation-operation-mod-rngintelt-rngintelt-rngintelt-2"></a>
### `n mod:= m: RngIntElt, RngIntElt -> RngIntElt`

## Bit Operations

The following functions use bit operations on the internal representation, so are in general quicker than using the usual arithmetic operators.

<a id="function-shiftleft-rngintelt-rngintelt"></a>
### `ShiftLeft(n, b): RngIntElt, RngIntElt -> RngIntElt`

Given integers $n$ and $b$, with $b\ge 0$, return $n \times 2^b$.

<a id="function-shiftright-rngintelt-rngintelt"></a>
### `ShiftRight(n, b): RngIntElt, RngIntElt -> RngIntElt`

Given integers $n$ and $b$, with $b\ge 0$, return $n$ `div` $2^b$.

<a id="function-modbypowerof2-rngintelt-rngintelt"></a>
### `ModByPowerOf2(n, b): RngIntElt, RngIntElt -> RngIntElt`

Given integers $n$ and $b$, with $b\ge 0$, return $n \bmod 2^b$ (so the result is always non-negative).

## Bitwise Operations

The following functions apply logical operators to integers by interpreting them as sequences of bits. Note that the (implicitly infinite) 2-adic expansion of these integers is used, which enables consistent handling of negative integers. In particular, the `BitwiseNot` of a non-negative integer will be negative, and vice versa.

<a id="function-bitwisenot-rngintelt"></a>
### `BitwiseNot(x): RngIntElt -> RngIntElt`

The integer whose 2-adic representation is the bitwise ‘not’ of the 2-adic representation of $x$.

<a id="function-bitwiseand-rngintelt-rngintelt"></a>
### `BitwiseAnd(x, y): RngIntElt, RngIntElt -> RngIntElt`

The integer whose 2-adic representation is the bitwise ‘and’ of the 2-adic representations of $x$ and $y$.

<a id="function-bitwiseor-rngintelt-rngintelt"></a>
### `BitwiseOr(x, y): RngIntElt, RngIntElt -> RngIntElt`

The integer whose 2-adic representation is the bitwise ‘or’ of the 2-adic representations of $x$ and $y$.

<a id="function-bitwisexor-rngintelt-rngintelt"></a>
### `BitwiseXor(x, y): RngIntElt, RngIntElt -> RngIntElt`

The integer whose 2-adic representation is the bitwise ‘xor’ of the 2-adic representations of $x$ and $y$.

## Equality and Membership

<a id="operation-op-eq-rngintelt-rngintelt"></a>
### `m eq n: RngIntElt, RngIntElt -> BoolElt`

<a id="operation-op-ne-rngintelt-rngintelt"></a>
### `m ne n: RngIntElt, RngIntElt -> BoolElt`

<a id="operation-op-in-rngintelt-rng"></a>
### `n in R: RngIntElt, Rng -> BoolElt`

<a id="operation-op-notin-rngintelt-rng"></a>
### `n notin R: RngIntElt, Rng -> BoolElt`

## Parent and Category

<a id="function-parent-rngintelt"></a>
### `Parent(n): RngIntElt -> RngInt`

<a id="function-category-rngintelt"></a>
### `Category(n): RngIntElt -> Cat`

## Predicates on Ring Elements

<a id="function-iseven-rngintelt"></a>
### `IsEven(n): RngIntElt -> BoolElt`

Returns `true` if the integer $n$ is even, otherwise `false`.

<a id="function-isodd-rngintelt"></a>
### `IsOdd(n): RngIntElt -> BoolElt`

Returns `true` if the integer $n$ is odd, otherwise `false`.

<a id="function-isdivisibleby-rngintelt-rngintelt"></a>
### `IsDivisibleBy(n, d): RngIntElt, RngIntElt -> BoolElt, RngIntElt`

Returns `true` if and only if the integer $n$ is divisible by the integer $d$; if `true`, the quotient of $n$ by $d$ is also returned.

<a id="function-issquare-rngintelt"></a>
### `IsSquare(n): RngIntElt -> BoolElt, RngIntElt`

Returns `true` if the non-negative integer $n$ is the square of an integer, `false` otherwise. If $n$ is a square, its positive square root is also returned.

<a id="function-issquarefree-rngintelt"></a>
### `IsSquarefree(n): RngIntElt -> BoolElt`

Returns `true` if the non-zero integer $n$ is not divisible by the square of any prime, `false` otherwise.

<a id="function-ispower-rngintelt"></a>
### `IsPower(n): RngIntElt -> BoolElt`

If the integer $n>1$ is a power $n=b^k$ of an integer $b$, with $k>1$, this function returns true, the minimal positive $b$ and its associated $k$; if it is not such integer power the function returns false.

<a id="function-ispower-rngintelt-rngintelt"></a>
### `IsPower(n, k): RngIntElt, RngIntElt -> BoolElt`

If the integer $n>1$ is $k$-th power, with $k>1$, of some integer $b$, so that $n=b^k$, this function returns true, and $b$; if it is not a $k$-th integer power the function returns false.

<a id="function-isprime-rngintelt"></a>
### `IsPrime(n): RngIntElt -> BoolElt`

```magma
Proof: BoolElt                    Default: true
```

Returns `true` if and only if the integer $n$ is a prime. A rigorous primality test which returns a proven result will be used unless the parameter `Proof` is `false`. The reader is referred to Section [Primes and Primality Testing](https://docs.magma-maths.org/v2.30-1/BasicRings/Integers/prime.md#rngint-primesfact) for a complete description of this function.

<a id="example-ex-687a13"></a>
### `Example: Primes Congruent to 3 Modulo 4 (ex-687a13)`

In this example we find some 10-digit primes that are congruent to 3 modulo 4 such that $(p-1)/2$ is also prime.

```magma
> { p : p in [10^10+3..10^10+1000 by 4] |
>        IsPrime(p) and IsPrime((p-1) div 2)};
{ 10000000259, 10000000643 }
```

<a id="function-isintegral-rngintelt"></a>
### `IsIntegral(n): RngIntElt -> BoolElt`

Returns `true` if and only if $a$ is integral, which is of course true for every integer $n$.

<a id="function-issingleprecision-rngintelt"></a>
### `IsSinglePrecision(n): RngIntElt -> BoolElt`

Returns `true` if $n$ fits in a single word in the internal representation of integers in Magma, that is, if $\vert n\vert<2^{30}$, `false` otherwise.

<a id="function-iszero-rngintelt"></a>
### `IsZero(n): RngIntElt -> BoolElt`

<a id="function-isone-rngintelt"></a>
### `IsOne(n): RngIntElt -> BoolElt`

<a id="function-isminusone-rngintelt"></a>
### `IsMinusOne(n): RngIntElt -> BoolElt`

<a id="function-isnilpotent-rngintelt"></a>
### `IsNilpotent(n): RngIntElt -> BoolElt`

<a id="function-isidempotent-rngintelt"></a>
### `IsIdempotent(n): RngIntElt -> BoolElt`

<a id="function-isunit-rngintelt"></a>
### `IsUnit(n): RngIntElt -> BoolElt`

<a id="function-iszerodivisor-rngintelt"></a>
### `IsZeroDivisor(n): RngIntElt -> BoolElt`

<a id="function-isregular-rngint"></a>
### `IsRegular(n): RngInt -> BoolElt`

<a id="function-isirreducible-rngintelt"></a>
### `IsIrreducible(n): RngIntElt -> BoolElt`

<a id="function-isprime-rngintelt-2"></a>
### `IsPrime(n): RngIntElt -> BoolElt`

## Comparison of Ring Elements

<a id="operation-op-gt-rngintelt-rngintelt"></a>
### `m gt n: RngIntElt, RngIntElt -> BoolElt`

<a id="operation-op-ge-rngintelt-rngintelt"></a>
### `m ge n: RngIntElt, RngIntElt -> BoolElt`

<a id="operation-op-lt-rngintelt-rngintelt"></a>
### `m lt n: RngIntElt, RngIntElt -> BoolElt`

<a id="operation-op-le-rngintelt-rngintelt"></a>
### `m le n: RngIntElt, RngIntElt -> BoolElt`

<a id="function-maximum-rngintelt-rngintelt"></a>
### `Maximum(m, n): RngIntElt, RngIntElt -> RngIntElt`

<a id="function-maximum-rngintelt"></a>
### `Maximum(Q): [RngIntElt] -> RngIntElt`

<a id="function-minimum-rngintelt-rngintelt"></a>
### `Minimum(m, n): RngIntElt, RngIntElt -> RngIntElt`

<a id="function-minimum-rngintelt"></a>
### `Minimum(Q): [RngIntElt] -> RngIntElt`

## Conjugates, Norm, and Trace

<a id="function-complexconjugate-rngintelt"></a>
### `ComplexConjugate(n): RngIntElt -> RngIntElt`

The complex conjugate of $n$, which will be the integer $n$ itself.

<a id="function-conjugate-rngintelt"></a>
### `Conjugate(n): RngIntElt -> RngIntElt`

The conjugate of $n$, which will be the integer $n$ itself.

<a id="function-norm-rngintelt"></a>
### `Norm(n): RngIntElt -> RngIntElt`

The norm in ${\mathbb{Q}}$ of $n$, which will be the integer $n$ itself.

<a id="function-euclideannorm-rngintelt"></a>
### `EuclideanNorm(n): RngIntElt -> RngIntElt`

The Euclidean norm (length) of $n$, which will equal the absolute value of $n$.

<a id="function-trace-rngintelt"></a>
### `Trace(n): RngIntElt -> RngIntElt`

The trace (in ${\mathbb{Q}}$) of $n$, which will be the integer $n$ itself.

<a id="function-minimalpolynomial-rngintelt"></a>
### `MinimalPolynomial(n): RngIntElt -> RngUPolElt`

Returns the minimal polynomial of the integer $n$, which is the monic linear polynomial with constant coefficient $n$ in a univariate polynomial ring $R$ over the integers.

## Other Elementary Functions

<a id="function-absolutevalue-rngintelt"></a>
### `AbsoluteValue(n): RngIntElt -> RngIntElt`

<a id="function-abs-rngintelt"></a>
### `Abs(n): RngIntElt -> RngIntElt`

Absolute value of the integer $n$.

<a id="function-ilog2-rngintelt"></a>
### `Ilog2(n): RngIntElt -> RngIntElt`

The integral part of the logarithm to the base two of the positive integer $n$.

<a id="function-ilog-rngintelt-rngintelt"></a>
### `Ilog(b, n): RngIntElt, RngIntElt -> RngIntElt`

The integral part of the logarithm to the base $b$ of the positive integer $n$ i.e., the largest integer $k$ such that $b^k \leq n$. The integer $b$ must be greater than or equal to two.

<a id="function-quotrem-rngintelt-rngintelt"></a>
### `Quotrem(m, n): RngIntElt, RngIntElt -> RngIntElt, RngIntElt`

Returns both the quotient $q$ and remainder $r$ obtained upon dividing the integer $m$ by the integer $n$, that is, $m = q\cdot n+r$, where $0 \leq r < n$ if $n>0$ and $n<r\leq 0$ if $n<0$.

<a id="function-valuation-rngintelt-rngintelt"></a>
### `Valuation(x, p): RngIntElt, RngIntElt -> RngIntElt, RngIntElt`

The valuation of the integer $x$ at the prime $p$. This is the largest integer $v$ for which $p^v$ divides $x$. If $x = 0$ then $v = \infty$. The optional second return value is the integer $u$ such that $x = p^v u$.

<a id="function-iroot-rngintelt-rngintelt"></a>
### `Iroot(a, n): RngIntElt, RngIntElt -> RngIntElt`

Given a positive integer $a$, return the integer $b= \lfloor\root n \of a\rfloor$, i.e. the integral part of the $n$-th root of $a$. To obtain the actual root (as a real number), $a$ must e coerced into a real field and the function `Root` applied.

<a id="function-sign-rngintelt"></a>
### `Sign(n): RngIntElt -> RngIntElt`

Returns $-1$, $0$, or $1$ depending upon whether the integer $n$ is negative, zero, or positive, respectively.

<a id="function-ceiling-rngintelt"></a>
### `Ceiling(n): RngIntElt -> RngIntElt`

The ceiling of the integer $n$, that is, $n$ itself.

<a id="function-floor-rngintelt"></a>
### `Floor(n): RngIntElt -> RngIntElt`

The floor of the integer $n$, that is, $n$ itself.

<a id="function-round-rngintelt"></a>
### `Round(n): RngIntElt -> RngIntElt`

This function rounds the integer $n$ to itself.

<a id="function-truncate-rngintelt"></a>
### `Truncate(n): RngIntElt -> RngIntElt`

This function returns the integer truncation of the integer $n$, that is, $n$ itself.

<a id="function-squarefreefactorization-rngintelt"></a>
### `SquarefreeFactorization(n): RngIntElt -> RngIntElt, RngIntElt`

Given a non-negative integer $n$, return a squarefree integer $x$ as well as a positive integer $y$, such that $n=xy^2$.

<a id="function-isqrt-rngintelt"></a>
### `Isqrt(n): RngIntElt -> RngIntElt`

Given a positive integer $n$, return the integer $\lfloor\sqrt n\rfloor$, i.e., the integral part of the square root of the integer $n$.
