Macaulay2 » Documentation
Packages » Padic » PadicNumber » precision(PadicNumber)
next | previous | forward | backward | up | index | toc

precision(PadicNumber) -- precision of a p-adic number

Description

Every $p$-adic number is stored with a maximum number of base $p$ digits. This is its precision.

i1 : x = QQ_7 (-1)

o1 = 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

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

o2 = 20
i3 : y = QQ_7(30, -2)

o3 = 5 + 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 + 6*7^20 + 6*7^21 + 6*7^22 + 6*7^23 + 6*7^24 +
     6*7^25 + 6*7^26 + 6*7^27 + 6*7^28 + 6*7^29

o3 : QQ  (of precision 30)
       7
i4 : precision y

o4 = 30

When performing binary operations on $p$-adic numbers, the result has the smallest of the two precisions.

i5 : x + y

o5 = 4 + 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

o5 : QQ  (of precision 20)
       7
i6 : precision oo

o6 = 20

Ways to use this method:


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