Skip to main content

PAdicInteger

Struct PAdicInteger 

Source
pub struct PAdicInteger {
    pub p: u64,
    pub digits: Vec<u64>,
}
Expand description

A p-adic integer represented by its base-p expansion (least significant digit first).

Fields§

§p: u64

The prime p.

§digits: Vec<u64>

Base-p digits, least significant first. Each digit satisfies 0 ≤ digit < p.

Implementations§

Source§

impl PAdicInteger

Source

pub fn new(p: u64, n: i64) -> Self

Construct the p-adic integer whose value is n (non-negative).

Source

pub fn zero(p: u64) -> Self

The zero element 0 ∈ ℤ_p.

Source

pub fn one(p: u64) -> Self

The unit element 1 ∈ ℤ_p.

Source

pub fn from_digits(p: u64, digits: Vec<u64>) -> Self

Construct from an explicit digit sequence.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.