pub struct Coef(/* private fields */);Expand description
Coefficient, represented by i128. The constant part of a Poly term.
All arithmetic is checked and panics on overflow.
Implementations§
Source§impl Coef
impl Coef
pub fn new<T: Into<i128>>(v: T) -> Self
pub fn from_size(v: usize) -> Self
pub fn get(&self) -> i128
pub fn vec(arr: &[i128]) -> Vec<Self>
pub fn is_zero(&self) -> bool
pub fn is_positive(&self) -> bool
pub fn gcd(&self, other: &Self) -> Self
pub fn lcm(&self, other: &Self) -> Self
pub fn abs(&self) -> Self
pub fn divrem(&self, other: Coef) -> (Self, Self)
Trait Implementations§
impl Copy for Coef
impl Eq for Coef
Source§impl Ord for Coef
impl Ord for Coef
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Coef
impl PartialOrd for Coef
impl StructuralPartialEq for Coef
Auto Trait Implementations§
impl Freeze for Coef
impl RefUnwindSafe for Coef
impl Send for Coef
impl Sync for Coef
impl Unpin for Coef
impl UnsafeUnpin for Coef
impl UnwindSafe for Coef
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