pub struct FloatingPoint<'st, const EB: usize, const SB: usize>(/* private fields */);Expand description
A floating-point number, parameterized by exponent bits (EB) and significand bits (SB). Significand bits include the sign bit.
Implementations§
Source§impl<'st, const EB: usize, const SB: usize> FloatingPoint<'st, EB, SB>
impl<'st, const EB: usize, const SB: usize> FloatingPoint<'st, EB, SB>
Sourcepub fn new(
st: &'st Storage,
value: impl IntoWithStorage<'st, FloatingPoint<'st, EB, SB>>,
) -> FloatingPoint<'st, EB, SB>
pub fn new( st: &'st Storage, value: impl IntoWithStorage<'st, FloatingPoint<'st, EB, SB>>, ) -> FloatingPoint<'st, EB, SB>
Construct a new bit-vec.
Sourcepub fn fp<const SB_1: usize>(
st: &'st Storage,
sign: BitVec<'st, 1>,
exponent: BitVec<'st, EB>,
significand: BitVec<'st, SB_1>,
) -> Self
pub fn fp<const SB_1: usize>( st: &'st Storage, sign: BitVec<'st, 1>, exponent: BitVec<'st, EB>, significand: BitVec<'st, SB_1>, ) -> Self
Creates a floating-point value from sign, exponent, and significand
bit-vectors. i = sb - 1
Note: The SB_1 parameter is a workaround for
#![feature(generic_const_exprs)].
Sourcepub fn minus_zero(st: &'st Storage) -> Self
pub fn minus_zero(st: &'st Storage) -> Self
Negative zero
Sourcepub fn fp_add(self, rm: RoundingMode<'st>, other: Self) -> Self
pub fn fp_add(self, rm: RoundingMode<'st>, other: Self) -> Self
Addition (fp.add)
Sourcepub fn fp_sub(self, rm: RoundingMode<'st>, other: Self) -> Self
pub fn fp_sub(self, rm: RoundingMode<'st>, other: Self) -> Self
Subtraction (fp.sub)
Sourcepub fn fp_mul(self, rm: RoundingMode<'st>, other: Self) -> Self
pub fn fp_mul(self, rm: RoundingMode<'st>, other: Self) -> Self
Multiplication (fp.mul)
Sourcepub fn fp_div(self, rm: RoundingMode<'st>, other: Self) -> Self
pub fn fp_div(self, rm: RoundingMode<'st>, other: Self) -> Self
Division (fp.div)
Sourcepub fn fp_fma(self, rm: RoundingMode<'st>, other1: Self, other2: Self) -> Self
pub fn fp_fma(self, rm: RoundingMode<'st>, other1: Self, other2: Self) -> Self
Fused multiplication and addition: (self * other1) + other2 (fp.fma)
Sourcepub fn fp_sqrt(self, rm: RoundingMode<'st>) -> Self
pub fn fp_sqrt(self, rm: RoundingMode<'st>) -> Self
Square root (fp.sqrt)
Sourcepub fn fp_rem(self, other: Self) -> Self
pub fn fp_rem(self, other: Self) -> Self
Remainder: self - other * n, where n in Z is nearest to self/other
(fp.rem)
Sourcepub fn fp_round_to_integral(self, rm: RoundingMode<'st>) -> Self
pub fn fp_round_to_integral(self, rm: RoundingMode<'st>) -> Self
Rounding to integral (fp.roundToIntegral)
Sourcepub fn fp_is_normal(self) -> Bool<'st>
pub fn fp_is_normal(self) -> Bool<'st>
Is normal (fp.isNormal)
Sourcepub fn fp_is_subnormal(self) -> Bool<'st>
pub fn fp_is_subnormal(self) -> Bool<'st>
Is subnormal (fp.isSubnormal)
Sourcepub fn fp_is_zero(self) -> Bool<'st>
pub fn fp_is_zero(self) -> Bool<'st>
Is zero (fp.isZero)
Sourcepub fn fp_is_infinite(self) -> Bool<'st>
pub fn fp_is_infinite(self) -> Bool<'st>
Is infinite (fp.isInfinite)
Sourcepub fn fp_is_negative(self) -> Bool<'st>
pub fn fp_is_negative(self) -> Bool<'st>
Is negative (fp.isNegative)
Sourcepub fn fp_is_positive(self) -> Bool<'st>
pub fn fp_is_positive(self) -> Bool<'st>
Is positive (fp.isPositive)
Sourcepub fn to_fp_from_bits<const M: usize>(
st: &'st Storage,
bv: BitVec<'st, M>,
) -> Self
pub fn to_fp_from_bits<const M: usize>( st: &'st Storage, bv: BitVec<'st, M>, ) -> Self
From single bitstring representation in IEEE 754-2008 interchange
format. M = EB + SB (to_fp)
Sourcepub fn to_fp_from_fp<const MB: usize, const NB: usize>(
st: &'st Storage,
rm: RoundingMode<'st>,
fp_other: FloatingPoint<'st, MB, NB>,
) -> Self
pub fn to_fp_from_fp<const MB: usize, const NB: usize>( st: &'st Storage, rm: RoundingMode<'st>, fp_other: FloatingPoint<'st, MB, NB>, ) -> Self
From another floating point sort (to_fp)
Sourcepub fn to_fp_from_real(
st: &'st Storage,
rm: RoundingMode<'st>,
real: Real<'st>,
) -> Self
pub fn to_fp_from_real( st: &'st Storage, rm: RoundingMode<'st>, real: Real<'st>, ) -> Self
From real (to_fp)
Sourcepub fn to_fp_from_signed_bit_vec<const M: usize>(
st: &'st Storage,
rm: RoundingMode<'st>,
bv: BitVec<'st, M>,
) -> Self
pub fn to_fp_from_signed_bit_vec<const M: usize>( st: &'st Storage, rm: RoundingMode<'st>, bv: BitVec<'st, M>, ) -> Self
From signed machine integer, represented as a 2’s complement bit vector
(to_fp)
Sourcepub fn to_fp_from_unsigned_bit_vec<const M: usize>(
st: &'st Storage,
rm: RoundingMode<'st>,
bv: BitVec<'st, M>,
) -> Self
pub fn to_fp_from_unsigned_bit_vec<const M: usize>( st: &'st Storage, rm: RoundingMode<'st>, bv: BitVec<'st, M>, ) -> Self
From unsigned machine integer, represented as bit vector
(to_fp_unsigned)
Sourcepub fn fp_to_ubv<const M: usize>(self, rm: RoundingMode<'st>) -> BitVec<'st, M>
pub fn fp_to_ubv<const M: usize>(self, rm: RoundingMode<'st>) -> BitVec<'st, M>
To unsigned machine integer, represented as a bit vector (fp.to_ubv)
Sourcepub fn fp_to_sbv<const M: usize>(self, rm: RoundingMode<'st>) -> BitVec<'st, M>
pub fn fp_to_sbv<const M: usize>(self, rm: RoundingMode<'st>) -> BitVec<'st, M>
To signed machine integer, represented as a 2’s complement bit vector
(fp.to_sbv)
Sourcepub fn fp_to_real(self) -> Real<'st>
pub fn fp_to_real(self) -> Real<'st>
To real (fp.to_real)
Trait Implementations§
impl<'st, const EB: usize, const SB: usize> Copy for FloatingPoint<'st, EB, SB>
Source§impl<'st, const EB: usize, const SB: usize> From<(STerm<'st>, Sort<'st>)> for FloatingPoint<'st, EB, SB>
impl<'st, const EB: usize, const SB: usize> From<(STerm<'st>, Sort<'st>)> for FloatingPoint<'st, EB, SB>
Source§impl<'st, const EB: usize, const SB: usize> From<Const<'st, FloatingPoint<'st, EB, SB>>> for FloatingPoint<'st, EB, SB>
impl<'st, const EB: usize, const SB: usize> From<Const<'st, FloatingPoint<'st, EB, SB>>> for FloatingPoint<'st, EB, SB>
Source§fn from(c: Const<'st, FloatingPoint<'st, EB, SB>>) -> Self
fn from(c: Const<'st, FloatingPoint<'st, EB, SB>>) -> Self
Source§impl<'st, const EB: usize, const SB: usize> From<FloatingPoint<'st, EB, SB>> for Dynamic<'st>
impl<'st, const EB: usize, const SB: usize> From<FloatingPoint<'st, EB, SB>> for Dynamic<'st>
Source§fn from(i: FloatingPoint<'st, EB, SB>) -> Self
fn from(i: FloatingPoint<'st, EB, SB>) -> Self
Source§impl<'st, const EB: usize, const SB: usize> From<FloatingPoint<'st, EB, SB>> for STerm<'st>
impl<'st, const EB: usize, const SB: usize> From<FloatingPoint<'st, EB, SB>> for STerm<'st>
Source§fn from(i: FloatingPoint<'st, EB, SB>) -> Self
fn from(i: FloatingPoint<'st, EB, SB>) -> Self
Source§impl<'st> IntoWithStorage<'st, FloatingPoint<'st, 8, 24>> for f32
impl<'st> IntoWithStorage<'st, FloatingPoint<'st, 8, 24>> for f32
Source§fn into_with_storage(self, st: &'st Storage) -> Float32<'st>
fn into_with_storage(self, st: &'st Storage) -> Float32<'st>
STerm with the presence of StorageSource§impl<'st> IntoWithStorage<'st, FloatingPoint<'st, 11, 53>> for f64
impl<'st> IntoWithStorage<'st, FloatingPoint<'st, 11, 53>> for f64
Source§fn into_with_storage(self, st: &'st Storage) -> Float64<'st>
fn into_with_storage(self, st: &'st Storage) -> Float64<'st>
STerm with the presence of StorageSource§impl<'st, const EB: usize, const SB: usize> StaticSorted<'st> for FloatingPoint<'st, EB, SB>
impl<'st, const EB: usize, const SB: usize> StaticSorted<'st> for FloatingPoint<'st, EB, SB>
Source§type Inner = FloatingPoint<'st, EB, SB>
type Inner = FloatingPoint<'st, EB, SB>
Const<'st, T>
where the inner type is T.Source§impl<'st> TryFrom<FloatingPoint<'st, 8, 24>> for f32
impl<'st> TryFrom<FloatingPoint<'st, 8, 24>> for f32
Auto Trait Implementations§
impl<'st, const EB: usize, const SB: usize> !RefUnwindSafe for FloatingPoint<'st, EB, SB>
impl<'st, const EB: usize, const SB: usize> !Send for FloatingPoint<'st, EB, SB>
impl<'st, const EB: usize, const SB: usize> !Sync for FloatingPoint<'st, EB, SB>
impl<'st, const EB: usize, const SB: usize> !UnwindSafe for FloatingPoint<'st, EB, SB>
impl<'st, const EB: usize, const SB: usize> Freeze for FloatingPoint<'st, EB, SB>
impl<'st, const EB: usize, const SB: usize> Unpin for FloatingPoint<'st, EB, SB>
impl<'st, const EB: usize, const SB: usize> UnsafeUnpin for FloatingPoint<'st, EB, SB>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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<'st, T> IntoWithStorage<'st, T> for T
impl<'st, T> IntoWithStorage<'st, T> for T
Source§fn into_with_storage(self, _st: &'st Storage) -> T
fn into_with_storage(self, _st: &'st Storage) -> T
STerm with the presence of StorageSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<'st, T> Sorted<'st> for Twhere
T: StaticSorted<'st>,
impl<'st, T> Sorted<'st> for Twhere
T: StaticSorted<'st>,
Source§type Inner = <T as StaticSorted<'st>>::Inner
type Inner = <T as StaticSorted<'st>>::Inner
Const<'st, T>
where the inner type is T.Source§fn sterm(self) -> STerm<'st>
fn sterm(self) -> STerm<'st>
Source§fn from_dynamic(d: Dynamic<'st>) -> Self
fn from_dynamic(d: Dynamic<'st>) -> Self
Source§fn try_from_dynamic(d: Dynamic<'st>) -> Option<Self>
fn try_from_dynamic(d: Dynamic<'st>) -> Option<Self>
Source§fn into_dynamic(self) -> Dynamic<'st>
fn into_dynamic(self) -> Dynamic<'st>
Source§fn _eq(self, other: impl IntoWithStorage<'st, Self::Inner>) -> Bool<'st>
fn _eq(self, other: impl IntoWithStorage<'st, Self::Inner>) -> Bool<'st>
(= self other)