Macaulay2 » Documentation
Packages » Padic » PadicNumber » unit
next | previous | forward | backward | up | index | toc

unit -- unit part of a p-adic number

Description

Every $x\in\QQ_p$ can be decomposed into a product $x=up^\nu$, where $u\in\ZZ_p^\times$, i.e., it is a unit in the ring of $p$-adic integers. This function returns $u$ as an integer.

i1 : x = QQ_7 (1/49)

o1 = 1*7^-2

o1 : QQ  (of precision 20)
       7
i2 : unit x

o2 = 1

Note that in general, $u$ has infinitely many $p$-adic digits. Therefore, it is truncated based on the precision of $x$.

i3 : x = QQ_7(-1/49)

o3 = 6*7^-2 + 6*7^-1 + 6 + 6*7^1 + 6*7^2 + 6*7^3 + 6*7^4 + 6*7^5 + 6*7^6 +
     6*7^7 + 6*7^8 + 6*7^9 + 6*7^10 + 6*7^11 + 6*7^12 + 6*7^13 + 6*7^14 +
     6*7^15 + 6*7^16 + 6*7^17 + 6*7^18 + 6*7^19

o3 : QQ  (of precision 20)
       7
i4 : unit x

o4 = 3909821048582988048

Ways to use unit:

  • unit(PadicNumber)

For the programmer

The object unit is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/Padic.m2:565:0.