next | previous | forward | backward | up | top | index | toc | Macaulay2 website
TestIdeals :: adicTruncation

adicTruncation -- truncation of a non-terminating adic expansion

Synopsis

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

Ways to use adicTruncation :

For the programmer

The object adicTruncation is a method function.