Expand description

P-adic numbers

padic is a collection of utilities to convert and manipulate p-adic numbers.

Structs

p-adic number struct with valuation, decimal expansion and prime.
Rational number struct with numerator, denominator and sign.

Functions

Extended Euclidean algorithm with Bezout’s coefficients https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm Bezout coefficients: ax + by == gcd(a,b)
Returns modular multiplicative inverse of a number. https://rosettacode.org/wiki/Modular_inverse#Rust
Returns a vector of (prime, exponent) tuples for a given number prime factorization. https://rosettacode.org/wiki/Prime_decomposition#Rust