# adicTruncation -- truncation of a non-terminating adic expansion

## Synopsis

• Usage:
t = adicTruncation(p, e, r)
T = adicTruncation(p, e, L)
• Inputs:
• p, an integer, greater than 1; the desired base
• e, an integer, nonnegative, which specifies where to truncate
• r, , nonnegative; the number whose truncation is to be computed
• L, a list, containing nonnegative rational numbers whose truncations are to be computed
• Outputs:
• t, , the e^{th} truncation of r (base p)
• T, a list, containing the e^{th} truncations (base p) of the elements of L

## Description

This function computes the $e^{th}$ truncation of the unique non-terminating $p$-adic expansion of a positive rational number $r$.

 i1 : adicTruncation(5, 2, 1/100) o1 = 0 o1 : QQ i2 : adicTruncation(5, 4, 1/100) 6 o2 = --- 625 o2 : QQ i3 : adicTruncation(5, 5, 1/1000) 3 o3 = ---- 3125 o3 : QQ

If $r = 0$, adicTruncation returns zero.

 i4 : adicTruncation(4, 2, 0) o4 = 0

If a list $L$ of nonnegative rational numbers is passed, adicTruncation(p, e, L) returns a list containing the $e^{th}$ truncations (base $p$) of those numbers.

 i5 : adicTruncation(5, 5, {1/100, 1/1000}) 31 3 o5 = {----, ----} 3125 3125 o5 : List

## See also

• adicExpansion -- compute adic expansion
• adicDigit -- compute a digit of the non-terminating expansion of a number in the unit interval in a given base

## Ways to use adicTruncation :

• "adicTruncation(ZZ,ZZ,List)"
• "adicTruncation(ZZ,ZZ,QQ)"
• "adicTruncation(ZZ,ZZ,ZZ)"

## For the programmer

The object adicTruncation is .