Struct amplify_num::posit::Posit32
source · pub struct Posit32(/* private fields */);
Implementations§
source§impl Posit32
impl Posit32
pub const ZERO: Posit32 = _
pub const NAR: Posit32 = _
pub const fn to_u32(&self) -> u32
pub const fn into_u32(self) -> u32
pub fn is_nar(&self) -> bool
pub fn is_zero(&self) -> bool
pub fn is_negative(&self) -> bool
pub fn is_positive(&self) -> bool
pub fn abs(self) -> Self
pub fn from_bits(bits: u32) -> Self
pub fn decode(&self) -> Result<(bool, i16, u32, u32), PositDecodeError>
pub fn encode(sign: bool, regime: i16, exp: u32, mantissa: u32) -> Self
Trait Implementations§
source§impl AddAssign for Posit32
impl AddAssign for Posit32
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl DivAssign for Posit32
impl DivAssign for Posit32
source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/=
operation. Read moresource§impl MulAssign for Posit32
impl MulAssign for Posit32
source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*=
operation. Read moresource§impl Ord for Posit32
impl Ord for Posit32
source§impl PartialEq for Posit32
impl PartialEq for Posit32
source§impl PartialOrd for Posit32
impl PartialOrd for Posit32
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl SubAssign for Posit32
impl SubAssign for Posit32
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreimpl Copy for Posit32
impl Eq for Posit32
impl StructuralPartialEq for Posit32
Auto Trait Implementations§
impl RefUnwindSafe for Posit32
impl Send for Posit32
impl Sync for Posit32
impl Unpin for Posit32
impl UnwindSafe for Posit32
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