Skip to content

AdicNumeral

A -adic number: the rational read in (or for prime ), exact when built from a rational, when capped. The ring operations work on it.

AdicNumeral(b, x)exact: any rational whose denominator can invert
AdicNumeral(b, x, prec) known modulo , normalised to its representative

Domain: Numeral systems

Details
  • Two values share the head. An EXACT adic is a rational, and its expansion can be produced to any depth (it is eventually periodic). A CAPPED adic is known only modulo — what a Hensel lift produces, and what any arithmetic with a capped operand yields; the precision of a sum is the weaker operand's, of a product
  • Prime gives the field : any non-zero divisor works and the result may have negative valuation (digits past the point). Composite gives the ring — no field, zero divisors, and division only by units (coprime to )
  • A rational the base cannot expand — in — leaves the call standing
  • A rational operand beside an adic one is read in the same base, so `AdicNumeral(10, 1/3) * 3` is `AdicNumeral(10, 1)`. Adics of different bases never combine
  • Not a compute-engine number type: the value is a function expression, and `Add`, `Multiply`, `Negate`, `Divide`, `Power` are wrapped to recognise it (`Subtract` reaches them by canonicalisation)
  • Default precision for anything unbounded — Hensel lifting, `AdicSqrt` — is 20 digits

Examples

See also: AdicExpansion, AdicValuation, AdicSqrt, HenselLift, IntegerDigits