Struct amplify_num::posit::Posit256
source · pub struct Posit256(/* private fields */);
Implementations§
source§impl Posit256
impl Posit256
pub const ZERO: Posit256 = _
pub const NAR: Posit256 = _
pub const fn to_u256(&self) -> u256
pub const fn into_u256(self) -> u256
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: u256) -> Self
pub fn decode(&self) -> Result<(bool, i16, u256, u256), PositDecodeError>
pub fn encode(sign: bool, regime: i16, exp: u256, mantissa: u256) -> Self
Trait Implementations§
source§impl AddAssign for Posit256
impl AddAssign for Posit256
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl DivAssign for Posit256
impl DivAssign for Posit256
source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/=
operation. Read moresource§impl MulAssign for Posit256
impl MulAssign for Posit256
source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*=
operation. Read moresource§impl Ord for Posit256
impl Ord for Posit256
source§impl PartialEq for Posit256
impl PartialEq for Posit256
source§impl PartialOrd for Posit256
impl PartialOrd for Posit256
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 Posit256
impl SubAssign for Posit256
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreimpl Copy for Posit256
impl Eq for Posit256
impl StructuralPartialEq for Posit256
Auto Trait Implementations§
impl RefUnwindSafe for Posit256
impl Send for Posit256
impl Sync for Posit256
impl Unpin for Posit256
impl UnwindSafe for Posit256
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