padic: Fast, type-safe p-adic arithmetic

[ library, math, mit, number-theory ] [ Propose Tags ] [ Report a vulnerability ]

Implementation of p-adic arithmetics on the base of fast modular arithmetics. Module introduces data types for p-adic integers and rationals with arbitrary precision as well as some specific functions (rational reconstruction, p-adic signum function, square roots etc.).


[Skip to Readme]

Modules

[Index] [Quick Jump]

  • Math
    • NumberTheory
      • Math.NumberTheory.Padic
        • Math.NumberTheory.Padic.Analysis
        • Math.NumberTheory.Padic.Integer
        • Math.NumberTheory.Padic.Rational
        • Math.NumberTheory.Padic.Types

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log ChangeLog.md
Dependencies base (>=4.14 && <4.17), constraints (>=0.13 && <0.14), integer-gmp (>=1.0.3 && <1.1), mod (>=0.1.2.2 && <1.3) [details]
Tested with ghc ==8.10.7
License MIT
Copyright 2022 Sergey B. Samoylenko
Author Sergey B. Samoylenko <samsergey@yandex.ru>
Maintainer samsergey@yandex.ru
Category Math, Number Theory
Home page https://github.com/samsergey/padic-0.1.0.0
Bug tracker https://github.com/samsergey/padic-0.1.0.0/issues
Source repo head: git clone https://github.com/samsergey/padic
Uploaded by samsergey at 2022-02-03T16:07:08Z
Distributions
Downloads 125 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for padic-0.1.0.0

[back to package description]

Math.NumberTheory.Padic

Module introduces p-adic integers and p-adic rational numbers of fixed and arbitratry precision, implementing basic arithmetic as well as some specific functions, i.e. detection of periodicity in digital sequence, rational reconstruction, square roots etc.

In order to gain efficiency the integer p-adic number with radix p is internally represented in form N mod p^k as only one digit N, lifted to modulo p^k, where k is chosen so that within working precision numbers belogning to Int and Ratio Int types could be reconstructed by extended Euclidean algorithm. Canonical expansion is used for textual output only.