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

PadicNumber -- base class for p-adic numbers

Description

Every $p$-adic number is an instance of the class QQ_p for the appropriate value of p. However, each of of these classes is a subclass of PadicNumber.

i1 : x = QQ_7 5

o1 = 5

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

o2 = {QQ , PadicNumber, Number, Thing}
        7

o2 : List

To install methods that work for all $p$-adic numbers, regardless of the specific field, install methods for this class.

i3 : foo = method()

o3 = foo

o3 : MethodFunction
i4 : foo PadicNumber := x -> x + 2

o4 = FunctionClosure[currentString:4:19-4:29]

o4 : FunctionClosure
i5 : foo x

o5 = 1*7^1

o5 : QQ  (of precision 20)
       7

Menu

Methods that use a p-adic number:

For the programmer

The object PadicNumber is a type, with ancestor classes Number < Thing.


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