pub struct Exp { /* private fields */ }Expand description
A signed rational exponent in lowest terms with a strictly positive denominator — so equal
exponents share one representation (Eq/Hash are structural). Admits fractional powers
(L^(1/2)) while the common integer case is just den == 1.
Implementations§
Source§impl Exp
impl Exp
Sourcepub fn new(num: i32, den: i32) -> Exp
pub fn new(num: i32, den: i32) -> Exp
Reduce num/den to lowest terms with a positive denominator. Panics on a zero denominator.
pub const fn numerator(self) -> i32
pub const fn denominator(self) -> i32
pub const fn is_zero(self) -> bool
Trait Implementations§
impl Copy for Exp
impl Eq for Exp
impl StructuralPartialEq for Exp
Auto Trait Implementations§
impl Freeze for Exp
impl RefUnwindSafe for Exp
impl Send for Exp
impl Sync for Exp
impl Unpin for Exp
impl UnsafeUnpin for Exp
impl UnwindSafe for Exp
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