This is Padic.info, produced by Macaulay2, version 1.26.05

Padic -- p-adic numbers
***********************

Description
===========

The field of $p$-adic numbers $\QQ_p$ consists of all formal Laurent series
$$\sum_{n=\nu}^\infty a_n p^n = a_\nu p^\nu + a_{\nu+1} p^{\nu+1} + \cdots,$$
where $\nu \in \ZZ$ and $a_n \in \{0, \ldots, p - 1\}$, together with the usual
operations of addition and multiplication in base $p$, with carrying that may
continue indefinitely.  Equivalently, $\QQ_p$ is the completion of $\QQ$ with
respect to the $p$-adic absolute value $|x|_p = p^{-\nu_p(x)}$, just as $\RR$
is the completion of $\QQ$ under the usual absolute value.

Elements of $\QQ_p$ are created by applying a p-adic field family,
to a rational number.  They are stored and displayed as
truncated series, with a default precision,
of 20 base-$p$ digits.

+--------------------------+
|i1 : x = QQ_7(12/7)       |
|                          |
|o1 = 5*7^-1 + 1           |
|                          |
|o1 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

This package is implemented using the ForeignFunctions,
package to call $p$-adic arithmetic routines from the
FLINT (see https://flintlib.org/ ) C library.

See the paper Implementing p-adic numbers in Macaulay2 using its foreign
function interface and FLINT (see https://arxiv.org/abs/2604.16799 ) for more
information.

Author
======

  * Doug Torrance (see https://webwork.piedmont.edu/~dtorrance )
    <dtorrance@piedmont.edu>

Version
=======

This documentation describes version 0.1 of Padic, released April 28, 2026.

Citation
========

If you have used this package in your research, please cite it as follows:

+-----------------------------------------------------------------------------+
|@misc{torrance2026implementingpadicnumbersmacaulay2,                         |
|  title={Implementing p-adic numbers in Macaulay2 using its foreign function |
|  author={Douglas A. Torrance},                                              |
|  year={2026},                                                               |
|  eprint={2604.16799},                                                       |
|  archivePrefix={arXiv},                                                     |
|  primaryClass={math.AG},                                                    |
|  url={https://arxiv.org/abs/2604.16799},                                    |
|}                                                                            |
|-----------------------------------------------------------------------------|
|interface and FLINT},                                                        |
+-----------------------------------------------------------------------------+

Exports
=======

  * Types
      * PadicFieldFamily -- class for p-adic fields
      * PadicNumber -- base class for p-adic numbers
  * Functions and commands
      * prime -- prime of a p-adic field or number
      * pVal -- p-adic valuation of a p-adic number
      * teichmullerLift -- Teichmüller lift of a p-adic
        integer
      * unit -- unit part of a p-adic number
  * Methods
      * abs(PadicNumber) -- p-adic absolute value
      * exp(PadicNumber) -- p-adic exponential
        function
      * "interval(Number,PadicNumber)" -- see
        interval(PadicNumber,PadicNumber),
        -- convert p-adic numbers to a
        real interval
      * "interval(PadicNumber)" -- see interval(PadicNumber,PadicNumber),
        -- convert p-adic numbers to a
        real interval
      * "interval(PadicNumber,Number)" -- see
        interval(PadicNumber,PadicNumber),
        -- convert p-adic numbers to a
        real interval
      * interval(PadicNumber,PadicNumber)
        -- convert p-adic numbers to a
        real interval
      * inverse(PadicNumber) -- multiplicative
        inverse of a p-adic number
      * "lift(PadicNumber,type of PadicNumber)" -- see
        lift(PadicNumber,type of ZZ), --
        lift a p-adic number to another ring
      * "lift(PadicNumber,type of QQ)" -- see lift(PadicNumber,type of ZZ),
        -- lift a p-adic number to
        another ring
      * lift(PadicNumber,type of ZZ),
        -- lift a p-adic number to another ring
      * "Number ^ PadicFieldFamily" -- see lift(PadicNumber,type of ZZ),
        -- lift a p-adic number to another
        ring
      * log(PadicNumber) -- p-adic logarithm
        function
      * new PadicNumber from Constant (missing documentation)
      * new PadicNumber from Number (missing documentation)
      * new PadicNumber from PadicNumber (missing documentation)
      * NewFromMethod(PadicNumber,ZZ,Constant) (missing documentation)
      * NewFromMethod(PadicNumber,ZZ,Number) (missing documentation)
      * "numeric(PadicNumber)" -- see numeric(ZZ,PadicNumber),
        -- convert a p-adic number to a real
        number
      * numeric(ZZ,PadicNumber), --
        convert a p-adic number to a real number
      * PadicFieldFamily Thing (missing documentation)
      * "Number * PadicNumber" -- see PadicNumber * PadicNumber,
        -- multiply p-adic numbers
      * "PadicNumber * Number" -- see PadicNumber * PadicNumber,
        -- multiply p-adic numbers
      * PadicNumber * PadicNumber, --
        multiply p-adic numbers
      * "+ PadicNumber" -- see PadicNumber + PadicNumber,
        -- add p-adic numbers
      * "Number + PadicNumber" -- see PadicNumber + PadicNumber,
        -- add p-adic numbers
      * "PadicNumber + Number" -- see PadicNumber + PadicNumber,
        -- add p-adic numbers
      * PadicNumber + PadicNumber -- add
        p-adic numbers
      * "- PadicNumber" -- see PadicNumber - PadicNumber,
        -- subtract or negate p-adic numbers
      * "Number - PadicNumber" -- see PadicNumber - PadicNumber,
        -- subtract or negate p-adic numbers
      * "PadicNumber - Number" -- see PadicNumber - PadicNumber,
        -- subtract or negate p-adic numbers
      * PadicNumber - PadicNumber -- subtract
        or negate p-adic numbers
      * "Number / PadicNumber" -- see PadicNumber / PadicNumber,
        -- divide p-adic numbers
      * "PadicNumber / Number" -- see PadicNumber / PadicNumber,
        -- divide p-adic numbers
      * PadicNumber / PadicNumber -- divide
        p-adic numbers
      * PadicNumber << ZZ -- multiply a p-adic number
        by a power of p
      * "Number == PadicNumber" -- see PadicNumber == PadicNumber,
        -- equality of p-adic numbers
      * "PadicNumber == Number" -- see PadicNumber == PadicNumber,
        -- equality of p-adic numbers
      * PadicNumber == PadicNumber, --
        equality of p-adic numbers
      * PadicNumber >> ZZ -- divide a p-adic number
        by a power of p
      * PadicNumber ^ ZZ -- raise a p-adic number to
        an integer power
      * padicValuation(PadicFieldFamily) (missing documentation)
      * precision(PadicNumber) -- precision
        of a p-adic number
      * "prime(PadicFieldFamily)" -- see prime, -- prime of a
        p-adic field or number
      * "prime(PadicNumber)" -- see prime, -- prime of a p-adic
        field or number
      * "Number _ PadicFieldFamily" -- see promote(ZZ,type of PadicNumber),
        -- promote a
        number to a p-adic field
      * "promote(PadicNumber,type of PadicNumber)" -- see promote(ZZ,type of PadicNumber),
        -- promote a
        number to a p-adic field
      * "promote(QQ,type of PadicNumber)" -- see promote(ZZ,type of PadicNumber),
        -- promote a
        number to a p-adic field
      * promote(ZZ,type of PadicNumber)
        -- promote a number to a p-adic field
      * "pVal(PadicNumber)" -- see pVal, -- p-adic valuation of a
        p-adic number
      * sqrt(PadicNumber) -- square root of a
        p-adic number
      * "teichmullerLift(PadicNumber)" -- see teichmullerLift,
        -- Teichmüller lift of a p-adic integer
      * "unit(PadicNumber)" -- see unit, -- unit part of a p-adic
        number
      * valuation(PadicFieldFamily) (missing documentation)

For the programmer
==================

The object Padic, is a package (Macaulay2Doc),
defined in Padic.m2.

-------------------------------------------------------------------------------

The source of this document is in Padic.m2:439:0.

PadicFieldFamily -- class for p-adic fields
*******************************************

Description
===========

For any prime $p$, the $p$-adic field $\QQ_p$ is represented in Macaulay2 by
the object QQ_p.

+---------------------+
|i1 : QQ_7            |
|                     |
|o1 = QQ              |
|       7             |
|                     |
|o1 : PadicFieldFamily|
+---------------------+
|i2 : class QQ_7      |
|                     |
|o2 = PadicFieldFamily|
|                     |
|o2 : Type            |
+---------------------+

Elements of $\QQ_p$ are created by applying the field to a number. The default
precision, is 20 base-$p$ digits; an explicit
precision $N$ may be supplied as a first argument.

+--------------------------+
|i3 : QQ_7 3               |
|                          |
|o3 = 3                    |
|                          |
|o3 : QQ  (of precision 20)|
|       7                  |
+--------------------------+
|i4 : QQ_7(30, 3)          |
|                          |
|o4 = 3                    |
|                          |
|o4 : QQ  (of precision 30)|
|       7                  |
+--------------------------+

Methods that use a p-adic field family:
=======================================

  * "Number ^ PadicFieldFamily" -- see lift(PadicNumber,type of ZZ),
    -- lift a p-adic number to another ring
  * PadicFieldFamily Thing (missing documentation)
  * padicValuation(PadicFieldFamily) (missing documentation)
  * "prime(PadicFieldFamily)" -- see prime, -- prime of a p-adic
    field or number
  * "Number _ PadicFieldFamily" -- see promote(ZZ,type of PadicNumber),
    -- promote a number to a p-adic
    field
  * valuation(PadicFieldFamily) (missing documentation)

For the programmer
==================

The object PadicFieldFamily, is a type (Macaulay2Doc),
with ancestor classes RingFamily (Macaulay2Doc),
< Type (Macaulay2Doc) <
MutableHashTable (Macaulay2Doc) < HashTable (Macaulay2Doc)
< Thing (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in Padic.m2:462:0.

prime -- prime of a p-adic field or number
******************************************

  * Usage:
        prime kk
        prime x
  * Inputs:
      * kk, a p-adic field family,
      * x, a p-adic number,
  * Outputs:
      * an integer (Macaulay2Doc),

Description
===========

Returns the prime $p$ of a $p$-adic field or number.

+-----------------+
|i1 : prime QQ_7  |
|                 |
|o1 = 7           |
+-----------------+
|i2 : prime QQ_7 3|
|                 |
|o2 = 7           |
+-----------------+

Ways to use prime:
==================

  * "prime(PadicFieldFamily)"
  * "prime(PadicNumber)"

For the programmer
==================

The object prime, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in Padic.m2:936:0.

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                                     |
+---------------------------------------------+

Methods that use a p-adic number:
=================================

  * abs(PadicNumber) -- p-adic absolute value
  * exp(PadicNumber) -- p-adic exponential
    function
  * "interval(Number,PadicNumber)" -- see
    interval(PadicNumber,PadicNumber),
    -- convert p-adic numbers to a real interval
  * "interval(PadicNumber)" -- see interval(PadicNumber,PadicNumber),
    -- convert p-adic numbers to a
    real interval
  * "interval(PadicNumber,Number)" -- see
    interval(PadicNumber,PadicNumber),
    -- convert p-adic numbers to a real interval
  * interval(PadicNumber,PadicNumber)
    -- convert p-adic numbers to a
    real interval
  * inverse(PadicNumber) -- multiplicative
    inverse of a p-adic number
  * "lift(PadicNumber,type of PadicNumber)" -- see lift(PadicNumber,type of ZZ),
    -- lift a p-adic number to
    another ring
  * "lift(PadicNumber,type of QQ)" -- see lift(PadicNumber,type of ZZ),
    -- lift a p-adic number to another ring
  * lift(PadicNumber,type of ZZ), --
    lift a p-adic number to another ring
  * log(PadicNumber) -- p-adic logarithm function
  * new PadicNumber from Constant (missing documentation)
  * new PadicNumber from Number (missing documentation)
  * new PadicNumber from PadicNumber (missing documentation)
  * NewFromMethod(PadicNumber,ZZ,Constant) (missing documentation)
  * NewFromMethod(PadicNumber,ZZ,Number) (missing documentation)
  * "numeric(PadicNumber)" -- see numeric(ZZ,PadicNumber),
    -- convert a p-adic number to a real number
  * numeric(ZZ,PadicNumber) -- convert a
    p-adic number to a real number
  * "Number * PadicNumber" -- see PadicNumber * PadicNumber,
    -- multiply p-adic numbers
  * "PadicNumber * Number" -- see PadicNumber * PadicNumber,
    -- multiply p-adic numbers
  * PadicNumber * PadicNumber -- multiply
    p-adic numbers
  * "+ PadicNumber" -- see PadicNumber + PadicNumber,
    -- add p-adic numbers
  * "Number + PadicNumber" -- see PadicNumber + PadicNumber,
    -- add p-adic numbers
  * "PadicNumber + Number" -- see PadicNumber + PadicNumber,
    -- add p-adic numbers
  * PadicNumber + PadicNumber -- add p-adic
    numbers
  * "- PadicNumber" -- see PadicNumber - PadicNumber,
    -- subtract or negate p-adic numbers
  * "Number - PadicNumber" -- see PadicNumber - PadicNumber,
    -- subtract or negate p-adic numbers
  * "PadicNumber - Number" -- see PadicNumber - PadicNumber,
    -- subtract or negate p-adic numbers
  * PadicNumber - PadicNumber -- subtract or
    negate p-adic numbers
  * "Number / PadicNumber" -- see PadicNumber / PadicNumber,
    -- divide p-adic numbers
  * "PadicNumber / Number" -- see PadicNumber / PadicNumber,
    -- divide p-adic numbers
  * PadicNumber / PadicNumber -- divide
    p-adic numbers
  * PadicNumber << ZZ -- multiply a p-adic number by
    a power of p
  * "Number == PadicNumber" -- see PadicNumber == PadicNumber,
    -- equality of p-adic numbers
  * "PadicNumber == Number" -- see PadicNumber == PadicNumber,
    -- equality of p-adic numbers
  * PadicNumber == PadicNumber -- equality
    of p-adic numbers
  * PadicNumber >> ZZ -- divide a p-adic number by a
    power of p
  * PadicNumber ^ ZZ -- raise a p-adic number to an
    integer power
  * precision(PadicNumber) -- precision of a
    p-adic number
  * "prime(PadicNumber)" -- see prime, -- prime of a p-adic field
    or number
  * "promote(PadicNumber,type of PadicNumber)" -- see promote(ZZ,type of PadicNumber),
    -- promote a number to
    a p-adic field
  * "promote(QQ,type of PadicNumber)" -- see promote(ZZ,type of PadicNumber),
    -- promote a number to
    a p-adic field
  * promote(ZZ,type of PadicNumber)
    -- promote a number to a p-adic field
  * "pVal(PadicNumber)" -- see pVal, -- p-adic valuation of a
    p-adic number
  * sqrt(PadicNumber) -- square root of a p-adic
    number
  * "teichmullerLift(PadicNumber)" -- see teichmullerLift,
    -- Teichmüller lift of a p-adic integer
  * "unit(PadicNumber)" -- see unit, -- unit part of a p-adic
    number

For the programmer
==================

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

-------------------------------------------------------------------------------

The source of this document is in Padic.m2:508:0.

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

  * Function: precision (Macaulay2Doc),
  * Usage:
        precision x
  * Inputs:
      * x, a p-adic number,
  * Outputs:
      * an integer (Macaulay2Doc),

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

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

The source of this document is in Padic.m2:536:0.

unit -- unit part of a p-adic number
************************************

  * Usage:
        unit x
  * Inputs:
      * x, a p-adic number,
  * Outputs:
      * an integer (Macaulay2Doc),

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 (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in Padic.m2:565:0.

pVal -- p-adic valuation of a p-adic number
*******************************************

  * Usage:
        pVal x
  * Inputs:
      * x, a p-adic number,
  * Outputs:
      * an integer (Macaulay2Doc), or InfiniteNumber (Macaulay2Doc),
        if x is zero

Description
===========

Returns the $p$-adic valuation $\nu_p(x)$, i.e., the exponent $\nu$ in the
factorization $x = u p^\nu$ where $u$ is a $p$-adic unit.

+-------------------+
|i1 : pVal QQ_7 49  |
|                   |
|o1 = 2             |
+-------------------+
|i2 : pVal QQ_7(1/7)|
|                   |
|o2 = -1            |
+-------------------+
|i3 : pVal QQ_7 0   |
|                   |
|o3 = infinity      |
|                   |
|o3 : InfiniteNumber|
+-------------------+

See also
========

  * unit -- unit part of a p-adic number
  * abs(PadicNumber) -- p-adic absolute value

Ways to use pVal:
=================

  * "pVal(PadicNumber)"

For the programmer
==================

The object pVal, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in Padic.m2:913:0.

PadicNumber == PadicNumber -- equality of p-adic numbers
********************************************************

  * Operator: == (Macaulay2Doc),
  * Usage:
        x == y
  * Inputs:
      * x, a p-adic number,
      * y, a p-adic number,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Test equality of two $p$-adic numbers.  Numbers in the same field are compared
directly.

+---------------------+
|i1 : QQ_7 3 == QQ_7 3|
|                     |
|o1 = true            |
+---------------------+
|i2 : QQ_7 3 == QQ_7 4|
|                     |
|o2 = false           |
+---------------------+

If the two numbers lie in different $p$-adic fields, or if one argument is an
ordinary number, equality is tested by comparing their lifts to QQ (Macaulay2Doc).

+---------------------+
|i3 : QQ_7 3 == QQ_5 3|
|                     |
|o3 = true            |
+---------------------+
|i4 : QQ_7 3 == 3     |
|                     |
|o4 = true            |
+---------------------+
|i5 : 3 == QQ_7 3     |
|                     |
|o5 = true            |
+---------------------+

Ways to use this method:
========================

  * "Number == PadicNumber"
  * "PadicNumber == Number"
  * PadicNumber == PadicNumber -- equality
    of p-adic numbers
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:966:0.

PadicNumber + PadicNumber -- add p-adic numbers
***********************************************

  * Operator: + (Macaulay2Doc),
  * Usage:
        x + y
  * Inputs:
      * x, a p-adic number,
      * y, a p-adic number,
  * Outputs:
      * a p-adic number, the sum of x and y;

Description
===========

Add two $p$-adic numbers.

+--------------------------+
|i1 : QQ_7 3 + QQ_7 11     |
|                          |
|o1 = 2*7^1                |
|                          |
|o1 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

If one of the arguments is an ordinary number, it is first promoted to the
appropriate $p$-adic field.

+--------------------------+
|i2 : QQ_7 3 + 4           |
|                          |
|o2 = 1*7^1                |
|                          |
|o2 : QQ  (of precision 20)|
|       7                  |
+--------------------------+
|i3 : 5 + QQ_7 6           |
|                          |
|o3 = 4 + 1*7^1            |
|                          |
|o3 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

When adding two $p$-adic numbers, the result has the smaller of the two
precision, values.

+------------------------------+
|i4 : QQ_7(10, 3) + QQ_7(20, 4)|
|                              |
|o4 = 1*7^1                    |
|                              |
|o4 : QQ  (of precision 10)    |
|       7                      |
+------------------------------+

The unary + operator is the identity.

+--------------------------+
|i5 : +QQ_7 3              |
|                          |
|o5 = 3                    |
|                          |
|o5 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

Ways to use this method:
========================

  * "+ PadicNumber"
  * "Number + PadicNumber"
  * "PadicNumber + Number"
  * PadicNumber + PadicNumber -- add p-adic
    numbers
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:604:0.

PadicNumber - PadicNumber -- subtract or negate p-adic numbers
**************************************************************

  * Operator: - (Macaulay2Doc),
  * Usage:
        x - y
        -x
  * Inputs:
      * x, a p-adic number,
      * y, a p-adic number,
  * Outputs:
      * a p-adic number, the difference of x and y, or the
        negation of x;

Description
===========

Subtract two $p$-adic numbers.

+--------------------------+
|i1 : QQ_7 11 - QQ_7 3     |
|                          |
|o1 = 1 + 1*7^1            |
|                          |
|o1 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

If one of the arguments is an ordinary number, it is first promoted to the
appropriate $p$-adic field.

+--------------------------+
|i2 : QQ_7 11 - 3          |
|                          |
|o2 = 1 + 1*7^1            |
|                          |
|o2 : QQ  (of precision 20)|
|       7                  |
+--------------------------+
|i3 : 11 - QQ_7 3          |
|                          |
|o3 = 1 + 1*7^1            |
|                          |
|o3 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

The unary - operator negates a $p$-adic number.

+---------------------------------------------------------------------------+
|i4 : -QQ_7 3                                                               |
|                                                                           |
|o4 = 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                                              |
|                                                                           |
|o4 : QQ  (of precision 20)                                                 |
|       7                                                                   |
+---------------------------------------------------------------------------+

See also
========

  * PadicNumber + PadicNumber -- add p-adic
    numbers

Ways to use this method:
========================

  * "- PadicNumber"
  * "Number - PadicNumber"
  * "PadicNumber - Number"
  * PadicNumber - PadicNumber -- subtract or
    negate p-adic numbers
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:639:0.

PadicNumber * PadicNumber -- multiply p-adic numbers
****************************************************

  * Operator: * (Macaulay2Doc),
  * Usage:
        x * y
  * Inputs:
      * x, a p-adic number,
      * y, a p-adic number,
  * Outputs:
      * a p-adic number, the product of x and y;

Description
===========

Multiply two $p$-adic numbers.

+--------------------------+
|i1 : QQ_7 3 * QQ_7 5      |
|                          |
|o1 = 1 + 2*7^1            |
|                          |
|o1 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

If one of the arguments is an ordinary number, it is first promoted to the
appropriate $p$-adic field.

+--------------------------+
|i2 : QQ_7 3 * 5           |
|                          |
|o2 = 1 + 2*7^1            |
|                          |
|o2 : QQ  (of precision 20)|
|       7                  |
+--------------------------+
|i3 : 4 * QQ_7 3           |
|                          |
|o3 = 5 + 1*7^1            |
|                          |
|o3 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

See also
========

  * PadicNumber + PadicNumber -- add p-adic
    numbers

Ways to use this method:
========================

  * "Number * PadicNumber"
  * "PadicNumber * Number"
  * PadicNumber * PadicNumber -- multiply
    p-adic numbers
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:671:0.

PadicNumber / PadicNumber -- divide p-adic numbers
**************************************************

  * Operator: / (Macaulay2Doc),
  * Usage:
        x / y
  * Inputs:
      * x, a p-adic number,
      * y, a p-adic number,
  * Outputs:
      * a p-adic number, the quotient of x and y;

Description
===========

Divide two $p$-adic numbers.

+--------------------------+
|i1 : QQ_2 3 / QQ_2 2      |
|                          |
|o1 = 1*2^-1 + 1           |
|                          |
|o1 : QQ  (of precision 20)|
|       2                  |
+--------------------------+

If one of the arguments is an ordinary number, it is first promoted to the
appropriate $p$-adic field.

+--------------------------+
|i2 : QQ_7 6 / 2           |
|                          |
|o2 = 3                    |
|                          |
|o2 : QQ  (of precision 20)|
|       7                  |
+--------------------------+
|i3 : 6 / QQ_7 2           |
|                          |
|o3 = 3                    |
|                          |
|o3 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

Caveat
======

An error is raised if y is zero.

See also
========

  * inverse(PadicNumber) -- multiplicative
    inverse of a p-adic number

Ways to use this method:
========================

  * "Number / PadicNumber"
  * "PadicNumber / Number"
  * PadicNumber / PadicNumber -- divide
    p-adic numbers
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:702:0.

inverse(PadicNumber) -- multiplicative inverse of a p-adic number
*****************************************************************

  * Function: inverse (Macaulay2Doc),
  * Usage:
        inverse x
  * Inputs:
      * x, a p-adic number,
  * Outputs:
      * a p-adic number, the multiplicative inverse of x;

Description
===========

Returns the multiplicative inverse of a $p$-adic number.

+---------------------------------------------------------------------------+
|i1 : inverse QQ_7 3                                                        |
|                                                                           |
|o1 = 5 + 4*7^1 + 4*7^2 + 4*7^3 + 4*7^4 + 4*7^5 + 4*7^6 + 4*7^7 + 4*7^8 +   |
|     4*7^9 + 4*7^10 + 4*7^11 + 4*7^12 + 4*7^13 + 4*7^14 + 4*7^15 + 4*7^16 +|
|     4*7^17 + 4*7^18 + 4*7^19                                              |
|                                                                           |
|o1 : QQ  (of precision 20)                                                 |
|       7                                                                   |
+---------------------------------------------------------------------------+
|i2 : QQ_7 3 * inverse QQ_7 3                                               |
|                                                                           |
|o2 = 1                                                                     |
|                                                                           |
|o2 : QQ  (of precision 20)                                                 |
|       7                                                                   |
+---------------------------------------------------------------------------+

Caveat
======

An error is raised if x is zero.

See also
========

  * PadicNumber / PadicNumber -- divide
    p-adic numbers

Ways to use this method:
========================

  * inverse(PadicNumber) -- multiplicative
    inverse of a p-adic number
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:725:0.

abs(PadicNumber) -- p-adic absolute value
*****************************************

  * Function: abs (Macaulay2Doc),
  * Usage:
        abs x
  * Inputs:
      * x, a p-adic number,
  * Outputs:
      * a rational number (Macaulay2Doc),

Description
===========

Returns the $p$-adic absolute value $|x|_p = p^{-\nu_p(x)}$.

+------------------+
|i1 : abs QQ_7 49  |
|                  |
|      1           |
|o1 = --           |
|     49           |
|                  |
|o1 : QQ           |
+------------------+
|i2 : abs QQ_7(1/7)|
|                  |
|o2 = 7            |
+------------------+
|i3 : abs QQ_7 0   |
|                  |
|o3 = 0            |
+------------------+

See also
========

  * pVal -- p-adic valuation of a p-adic number

Ways to use this method:
========================

  * abs(PadicNumber) -- p-adic absolute value
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:747:0.

PadicNumber << ZZ -- multiply a p-adic number by a power of p
*************************************************************

  * Operator: << (Macaulay2Doc),
  * Usage:
        x << n
  * Inputs:
      * x, a p-adic number,
      * n, an integer (Macaulay2Doc),
  * Outputs:
      * a p-adic number, x times p^n;

Description
===========

Returns $x \cdot p^n$, shifting the $p$-adic expansion left by $n$ places. A
negative shift divides by $p^{|n|}$.

+--------------------------+
|i1 : QQ_7 3 << 2          |
|                          |
|o1 = 3*7^2                |
|                          |
|o1 : QQ  (of precision 20)|
|       7                  |
+--------------------------+
|i2 : QQ_7 3 << -1         |
|                          |
|o2 = 3*7^-1               |
|                          |
|o2 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

Ways to use this method:
========================

  * PadicNumber << ZZ -- multiply a p-adic number by
    a power of p
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:770:0.

PadicNumber >> ZZ -- divide a p-adic number by a power of p
***********************************************************

  * Operator: >> (Macaulay2Doc),
  * Usage:
        x >> n
  * Inputs:
      * x, a p-adic number,
      * n, an integer (Macaulay2Doc),
  * Outputs:
      * a p-adic number, x divided by p^n;

Description
===========

Returns $x / p^n = x \cdot p^{-n}$, shifting the $p$-adic expansion right by
$n$ places.  A negative shift multiplies by $p^{|n|}$.

+--------------------------+
|i1 : QQ_7 3 >> 2          |
|                          |
|o1 = 3*7^-2               |
|                          |
|o1 : QQ  (of precision 20)|
|       7                  |
+--------------------------+
|i2 : QQ_7 3 >> -1         |
|                          |
|o2 = 3*7^1                |
|                          |
|o2 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

See also
========

  * PadicNumber << ZZ -- multiply a p-adic number by
    a power of p

Ways to use this method:
========================

  * PadicNumber >> ZZ -- divide a p-adic number by a
    power of p
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:793:0.

PadicNumber ^ ZZ -- raise a p-adic number to an integer power
*************************************************************

  * Operator: ^ (Macaulay2Doc),
  * Usage:
        x^n
  * Inputs:
      * x, a p-adic number,
      * n, an integer (Macaulay2Doc),
  * Outputs:
      * a p-adic number, x raised to the n-th power;

Description
===========

Raise a $p$-adic number to an integer power.

+---------------------------------------------------------------------------+
|i1 : (QQ_7 3)^2                                                            |
|                                                                           |
|o1 = 2 + 1*7^1                                                             |
|                                                                           |
|o1 : QQ  (of precision 20)                                                 |
|       7                                                                   |
+---------------------------------------------------------------------------+
|i2 : (QQ_7 3)^(-1)                                                         |
|                                                                           |
|o2 = 5 + 4*7^1 + 4*7^2 + 4*7^3 + 4*7^4 + 4*7^5 + 4*7^6 + 4*7^7 + 4*7^8 +   |
|     4*7^9 + 4*7^10 + 4*7^11 + 4*7^12 + 4*7^13 + 4*7^14 + 4*7^15 + 4*7^16 +|
|     4*7^17 + 4*7^18 + 4*7^19                                              |
|                                                                           |
|o2 : QQ  (of precision 20)                                                 |
|       7                                                                   |
+---------------------------------------------------------------------------+

Ways to use this method:
========================

  * PadicNumber ^ ZZ -- raise a p-adic number to an
    integer power
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:815:0.

sqrt(PadicNumber) -- square root of a p-adic number
***************************************************

  * Function: sqrt (Macaulay2Doc),
  * Usage:
        sqrt x
  * Inputs:
      * x, a p-adic number,
  * Outputs:
      * a p-adic number, a square root of x;

Description
===========

Returns a square root of a $p$-adic number.

+---------------------------------------------------------------------------+
|i1 : sqrt QQ_7 2                                                           |
|                                                                           |
|o1 = 3 + 1*7^1 + 2*7^2 + 6*7^3 + 1*7^4 + 2*7^5 + 1*7^6 + 2*7^7 + 4*7^8 +   |
|     6*7^9 + 6*7^10 + 2*7^11 + 1*7^12 + 1*7^13 + 2*7^15 + 1*7^16 + 1*7^17 +|
|     4*7^18 + 6*7^19                                                       |
|                                                                           |
|o1 : QQ  (of precision 20)                                                 |
|       7                                                                   |
+---------------------------------------------------------------------------+
|i2 : oo^2                                                                  |
|                                                                           |
|o2 = 2                                                                     |
|                                                                           |
|o2 : QQ  (of precision 20)                                                 |
|       7                                                                   |
+---------------------------------------------------------------------------+

Caveat
======

An error is raised if x is not a $p$-adic square.

See also
========

  * PadicNumber ^ ZZ -- raise a p-adic number to an
    integer power

Ways to use this method:
========================

  * sqrt(PadicNumber) -- square root of a p-adic
    number
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:838:0.

exp(PadicNumber) -- p-adic exponential function
***********************************************

  * Function: exp (Macaulay2Doc),
  * Usage:
        exp x
  * Inputs:
      * x, a p-adic number,
  * Outputs:
      * a p-adic number, the p-adic exponential of x;

Description
===========

Returns the $p$-adic exponential of $x$, defined by the power series $\exp_p x
= \sum_{n=0}^\infty x^n / n!$.  The series converges when $|x|_p <
p^{-1/(p-1)}$.

+----------------------------------------------------------------------------+
|i1 : exp QQ_7 7                                                             |
|                                                                            |
|o1 = 1 + 1*7^1 + 4*7^2 + 2*7^3 + 3*7^5 + 2*7^6 + 4*7^7 + 3*7^8 + 4*7^9 +    |
|     2*7^10 + 4*7^11 + 1*7^13 + 1*7^14 + 3*7^15 + 3*7^16 + 4*7^17 + 5*7^18 +|
|     1*7^19                                                                 |
|                                                                            |
|o1 : QQ  (of precision 20)                                                  |
|       7                                                                    |
+----------------------------------------------------------------------------+
|i2 : log oo                                                                 |
|                                                                            |
|o2 = 1*7^1                                                                  |
|                                                                            |
|o2 : QQ  (of precision 20)                                                  |
|       7                                                                    |
+----------------------------------------------------------------------------+

Caveat
======

An error is raised if the series does not converge.

Ways to use this method:
========================

  * exp(PadicNumber) -- p-adic exponential
    function
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:863:0.

log(PadicNumber) -- p-adic logarithm function
*********************************************

  * Function: log (Macaulay2Doc),
  * Usage:
        log x
  * Inputs:
      * x, a p-adic number,
  * Outputs:
      * a p-adic number, the p-adic logarithm of x;

Description
===========

Returns the $p$-adic logarithm of $x$, defined by the power series $\log_p x =
\sum_{n=1}^\infty (-1)^{n-1}(x-1)^n/n$.  The series converges when $|x - 1|_p <
1$.

+--------------------------+
|i1 : log exp QQ_7 7       |
|                          |
|o1 = 1*7^1                |
|                          |
|o1 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

Caveat
======

An error is raised if the series does not converge.

See also
========

  * exp(PadicNumber) -- p-adic exponential
    function

Ways to use this method:
========================

  * log(PadicNumber) -- p-adic logarithm function
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:887:0.

teichmullerLift -- Teichmüller lift of a p-adic integer
*******************************************************

  * Usage:
        teichmullerLift x
  * Inputs:
      * x, a p-adic number,
  * Outputs:
      * a p-adic number,

Description
===========

Returns the Teichmüller lift of $x$, which is the unique root of unity $t \in
\ZZ_p^\times$ satisfying $t \equiv x \pmod{p}$ and $t^p = t$.

+----------------------------------------------------------------------------+
|i1 : t = teichmullerLift QQ_7 3                                             |
|                                                                            |
|o1 = 3 + 4*7^1 + 6*7^2 + 3*7^3 + 2*7^5 + 6*7^6 + 2*7^7 + 4*7^8 + 3*7^9 +    |
|     4*7^10 + 4*7^11 + 5*7^12 + 2*7^13 + 1*7^14 + 2*7^15 + 1*7^16 + 4*7^17 +|
|     6*7^18 + 1*7^19                                                        |
|                                                                            |
|o1 : QQ  (of precision 20)                                                  |
|       7                                                                    |
+----------------------------------------------------------------------------+
|i2 : t^7 == t                                                               |
|                                                                            |
|o2 = true                                                                   |
+----------------------------------------------------------------------------+

Caveat
======

An error is raised if $\nu_p(x) < 0$, i.e., if $x$ is not a $p$-adic integer.

Ways to use teichmullerLift:
============================

  * "teichmullerLift(PadicNumber)"

For the programmer
==================

The object teichmullerLift, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in Padic.m2:989:0.

lift(PadicNumber,type of ZZ) -- lift a p-adic number to another ring
********************************************************************

  * Function: lift (Macaulay2Doc),
  * Usage:
        lift(x, R)
        x^R
  * Inputs:
      * x, a p-adic number,
      * R, an integer (Macaulay2Doc), a rational number (Macaulay2Doc),
        or a p-adic number,
  * Optional inputs (Macaulay2Doc),:
      * Verify => ..., default value true
  * Outputs:
      * a number (Macaulay2Doc), an element of R;

Description
===========

Lift a $p$-adic number to an other ring.  This is only well-defined when R to
ZZ (Macaulay2Doc), QQ (Macaulay2Doc), or the $p$-adic field
containing x.

+--------------------------+
|i1 : x = QQ_7 49          |
|                          |
|o1 = 1*7^2                |
|                          |
|o1 : QQ  (of precision 20)|
|       7                  |
+--------------------------+
|i2 : lift(x, ZZ)          |
|                          |
|o2 = 49                   |
+--------------------------+
|i3 : lift(x, QQ)          |
|                          |
|o3 = 49                   |
|                          |
|o3 : QQ                   |
+--------------------------+
|i4 : lift(x, QQ_7)        |
|                          |
|o4 = 1*7^2                |
|                          |
|o4 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

As usual, the ^ (Macaulay2Doc), operator is a shorthand for this
operation.

+--------------------------+
|i5 : x^ZZ                 |
|                          |
|o5 = 49                   |
+--------------------------+
|i6 : x^QQ                 |
|                          |
|o6 = 49                   |
|                          |
|o6 : QQ                   |
+--------------------------+
|i7 : x^(QQ_7)             |
|                          |
|o7 = 1*7^2                |
|                          |
|o7 : QQ  (of precision 20)|
|       7                  |
+--------------------------+

Caveat
======

Lifting to ZZ (Macaulay2Doc), raises an error if the $p$-adic
valuation of x is negative.

See also
========

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

Ways to use this method:
========================

  * "lift(PadicNumber,type of PadicNumber)"
  * "lift(PadicNumber,type of QQ)"
  * lift(PadicNumber,type of ZZ), --
    lift a p-adic number to another ring
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:1028:0.

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

  * Function: promote (Macaulay2Doc),
  * Usage:
        promote(x, kk)
        x_kk
  * Inputs:
      * x, an integer (Macaulay2Doc), a rational number (Macaulay2Doc),
        or a p-adic number,
      * kk, a p-adic number,
  * Outputs:
      * a p-adic number,

Description
===========

Promote an integer, rational, or $p$-adic number to the given $p$-adic field.
The subscript operator _ (Macaulay2Doc), 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
========

  * lift(PadicNumber,type of ZZ), --
    lift a p-adic number to another ring

Ways to use this method:
========================

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

The source of this document is in Padic.m2:1057:0.

numeric(ZZ,PadicNumber) -- convert a p-adic number to a real number
*******************************************************************

  * Function: numeric (Macaulay2Doc),
  * Usage:
        numeric(prec, x)
        numeric x
  * Inputs:
      * prec, an integer (Macaulay2Doc), number of bits of precision;
      * x, a p-adic number,
  * Outputs:
      * a real number (Macaulay2Doc),

Description
===========

Converts a $p$-adic number to a floating-point real number by first lifting to
QQ (Macaulay2Doc).

+--------------------------+
|i1 : numeric QQ_7 5       |
|                          |
|o1 = 5                    |
|                          |
|o1 : RR (of precision 53) |
+--------------------------+
|i2 : numeric(100, QQ_7 5) |
|                          |
|o2 = 5                    |
|                          |
|o2 : RR (of precision 100)|
+--------------------------+

See also
========

  * interval(PadicNumber), --
    convert p-adic numbers to a real interval
  * lift(PadicNumber,type of ZZ), --
    lift a p-adic number to another ring

Ways to use this method:
========================

  * "numeric(PadicNumber)"
  * numeric(ZZ,PadicNumber) -- convert a
    p-adic number to a real number
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:1083:0.

interval(PadicNumber,PadicNumber) -- convert p-adic numbers to a real interval
******************************************************************************

  * Function: interval (Macaulay2Doc),
  * Usage:
        interval(x, y)
        interval x
  * Inputs:
      * x, a p-adic number, or a number (Macaulay2Doc),
      * y, a p-adic number, or a number (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Precision => ..., default value -1
  * Outputs:
      * a real interval (Macaulay2Doc),

Description
===========

Converts a $p$-adic number to a real interval by first lifting to QQ (Macaulay2Doc).
When two arguments are given, returns the interval with
those endpoints.

+-----------------------------+
|i1 : interval QQ_7 5         |
|                             |
|o1 = [5,5]                   |
|                             |
|o1 : RRi (of precision 53)   |
+-----------------------------+
|i2 : interval(QQ_7 5, QQ_7 6)|
|                             |
|o2 = [5,6]                   |
|                             |
|o2 : RRi (of precision 53)   |
+-----------------------------+
|i3 : interval(QQ_7 5, 6)     |
|                             |
|o3 = [5,6]                   |
|                             |
|o3 : RRi (of precision 53)   |
+-----------------------------+
|i4 : interval(5, QQ_7 6)     |
|                             |
|o4 = [5,6]                   |
|                             |
|o4 : RRi (of precision 53)   |
+-----------------------------+

See also
========

  * numeric(PadicNumber) -- convert a
    p-adic number to a real number

Ways to use this method:
========================

  * "interval(Number,PadicNumber)"
  * "interval(PadicNumber)"
  * "interval(PadicNumber,Number)"
  * interval(PadicNumber,PadicNumber)
    -- convert p-adic numbers to a
    real interval
-------------------------------------------------------------------------------

The source of this document is in Padic.m2:1113:0.