P-adic numbers

crate documentation minimum rustc 1.31

A collection of tools for p-adic numbers in Rust.

This includes a p-adic type and a rational type.

P-adic notation for the expansion is currently left to right.

Status

This library is currently in development and might be unstable.

Usage

Add this to your Cargo.toml:

toml [dependencies] padic = "0.1.5"

rust use padic::Ratio; let ratio = Ratio::new(2, 5); let padic = r.to_padic(3, 12); assert_eq!(padic.valuation, 0); assert_eq!(padic.expansion, vec![1, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1]); assert_eq!(padic.to_string(), "... 1 2 1 0 1 2 1 0 1 2 1 1"); assert_eq!(padic.cycle(), [1, 2, 1, 0]);

Helpers functions

Resources

TODOs

Ratio

P-adic

Bugs / Features

License

MIT