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
Double cursor window cycle detection algorithm.
https://rosettacode.org/wiki/Cycle_detection
https://en.wikipedia.org/wiki/Cycle_detection
Extended Euclidean algorithm with Bezout’s coefficients
https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm
Bezout coefficients: ax + by == gcd(a,b)
Check if number is prime.
https://rosettacode.org/wiki/Primality_by_trial_division#Rust
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