Macaulay2 » Documentation
Packages » Padic » PadicNumber » promote(ZZ,type of PadicNumber)
next | previous | forward | backward | up | index | toc

promote(ZZ,type of PadicNumber) -- promote a number to a p-adic field

Description

Promote an integer, rational, or $p$-adic number to the given $p$-adic field. The subscript operator _ may also be used.

i1 : promote(3, QQ_7)

o1 = 3

o1 : QQ  (of precision 20)
       7
i2 : promote(3/2, QQ_7)

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

o2 : QQ  (of precision 20)
       7
i3 : 3_(QQ_7)

o3 = 3

o3 : QQ  (of precision 20)
       7
i4 : (3/2)_(QQ_7)

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

o4 : QQ  (of precision 20)
       7

See also

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:1057:0.