pub struct FlintInteger { /* private fields */ }Expand description
Safe wrapper over FLINT’s fmpz_t — arbitrary-precision integer.
Memory is managed by FLINT’s allocator. Drop calls fmpz_clear.
All raw pointers are confined to this file; callers see only safe Rust.
Implementations§
Source§impl FlintInteger
impl FlintInteger
pub fn new() -> Self
pub fn from_i64(val: i64) -> Self
Sourcepub fn to_i64(&self) -> i64
pub fn to_i64(&self) -> i64
Return as i64. For values that overflow i64 this wraps/truncates —
use to_string() for a lossless decimal representation.
pub fn gcd(&self, other: &Self) -> Self
pub fn pow(&self, exp: u64) -> Self
Trait Implementations§
Source§impl<'b> Add<&'b FlintInteger> for &FlintInteger
impl<'b> Add<&'b FlintInteger> for &FlintInteger
Source§type Output = FlintInteger
type Output = FlintInteger
The resulting type after applying the
+ operator.Source§fn add(self, rhs: &'b FlintInteger) -> FlintInteger
fn add(self, rhs: &'b FlintInteger) -> FlintInteger
Performs the
+ operation. Read moreSource§impl Add for FlintInteger
impl Add for FlintInteger
Source§impl Clone for FlintInteger
impl Clone for FlintInteger
Source§impl Debug for FlintInteger
impl Debug for FlintInteger
Source§impl Default for FlintInteger
impl Default for FlintInteger
Source§impl Display for FlintInteger
impl Display for FlintInteger
Source§impl<'b> Div<&'b FlintInteger> for &FlintInteger
impl<'b> Div<&'b FlintInteger> for &FlintInteger
Source§type Output = FlintInteger
type Output = FlintInteger
The resulting type after applying the
/ operator.Source§fn div(self, rhs: &'b FlintInteger) -> FlintInteger
fn div(self, rhs: &'b FlintInteger) -> FlintInteger
Performs the
/ operation. Read moreSource§impl Div for FlintInteger
Truncated (toward-zero) division, matching Rust’s built-in integer /.
impl Div for FlintInteger
Truncated (toward-zero) division, matching Rust’s built-in integer /.
Source§impl Drop for FlintInteger
impl Drop for FlintInteger
Source§impl<'b> Mul<&'b FlintInteger> for &FlintInteger
impl<'b> Mul<&'b FlintInteger> for &FlintInteger
Source§type Output = FlintInteger
type Output = FlintInteger
The resulting type after applying the
* operator.Source§fn mul(self, rhs: &'b FlintInteger) -> FlintInteger
fn mul(self, rhs: &'b FlintInteger) -> FlintInteger
Performs the
* operation. Read moreSource§impl Mul for FlintInteger
impl Mul for FlintInteger
Source§impl Neg for &FlintInteger
impl Neg for &FlintInteger
Source§type Output = FlintInteger
type Output = FlintInteger
The resulting type after applying the
- operator.Source§fn neg(self) -> FlintInteger
fn neg(self) -> FlintInteger
Performs the unary
- operation. Read moreSource§impl Neg for FlintInteger
impl Neg for FlintInteger
Source§impl PartialEq for FlintInteger
impl PartialEq for FlintInteger
Source§impl<'b> Rem<&'b FlintInteger> for &FlintInteger
impl<'b> Rem<&'b FlintInteger> for &FlintInteger
Source§type Output = FlintInteger
type Output = FlintInteger
The resulting type after applying the
% operator.Source§fn rem(self, rhs: &'b FlintInteger) -> FlintInteger
fn rem(self, rhs: &'b FlintInteger) -> FlintInteger
Performs the
% operation. Read moreSource§impl Rem for FlintInteger
Remainder after truncated division, matching Rust’s built-in %.
impl Rem for FlintInteger
Remainder after truncated division, matching Rust’s built-in %.
Source§impl<'b> Sub<&'b FlintInteger> for &FlintInteger
impl<'b> Sub<&'b FlintInteger> for &FlintInteger
Source§type Output = FlintInteger
type Output = FlintInteger
The resulting type after applying the
- operator.Source§fn sub(self, rhs: &'b FlintInteger) -> FlintInteger
fn sub(self, rhs: &'b FlintInteger) -> FlintInteger
Performs the
- operation. Read moreSource§impl Sub for FlintInteger
impl Sub for FlintInteger
impl Eq for FlintInteger
impl Send for FlintInteger
impl Sync for FlintInteger
Auto Trait Implementations§
impl Freeze for FlintInteger
impl RefUnwindSafe for FlintInteger
impl Unpin for FlintInteger
impl UnsafeUnpin for FlintInteger
impl UnwindSafe for FlintInteger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Casts the value.
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.