Struct softfloat_wrapper::BF16

source ·
pub struct BF16(_);
Expand description

bfloat16

Implementations§

source§

impl BF16

source

pub fn from_f32(v: f32) -> Self

Converts primitive f32 to BF16

source

pub fn from_f64(v: f64) -> Self

Converts primitive f64 to BF16

Trait Implementations§

source§

impl Clone for BF16

source§

fn clone(&self) -> BF16

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BF16

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Float for BF16

§

type Payload = u16

source§

const EXPONENT_BIT: Self::Payload = {transmute(0x00ff): <bf16::BF16 as Float>::Payload}

source§

const FRACTION_BIT: Self::Payload = {transmute(0x007f): <bf16::BF16 as Float>::Payload}

source§

const SIGN_POS: usize = 15usize

source§

const EXPONENT_POS: usize = 7usize

source§

fn set_payload(&mut self, x: Self::Payload)

source§

fn from_bits(v: Self::Payload) -> Self

source§

fn to_bits(&self) -> Self::Payload

source§

fn bits(&self) -> Self::Payload

👎Deprecated since 0.3.0: Please use to_bits instead
source§

fn add<T: Borrow<Self>>(&self, x: T, rnd: RoundingMode) -> Self

source§

fn sub<T: Borrow<Self>>(&self, x: T, rnd: RoundingMode) -> Self

source§

fn mul<T: Borrow<Self>>(&self, x: T, rnd: RoundingMode) -> Self

source§

fn fused_mul_add<T: Borrow<Self>>(&self, x: T, y: T, rnd: RoundingMode) -> Self

source§

fn div<T: Borrow<Self>>(&self, x: T, rnd: RoundingMode) -> Self

source§

fn rem<T: Borrow<Self>>(&self, x: T, rnd: RoundingMode) -> Self

source§

fn sqrt(&self, rnd: RoundingMode) -> Self

source§

fn eq<T: Borrow<Self>>(&self, x: T) -> bool

source§

fn lt<T: Borrow<Self>>(&self, x: T) -> bool

source§

fn le<T: Borrow<Self>>(&self, x: T) -> bool

source§

fn lt_quiet<T: Borrow<Self>>(&self, x: T) -> bool

source§

fn le_quiet<T: Borrow<Self>>(&self, x: T) -> bool

source§

fn eq_signaling<T: Borrow<Self>>(&self, x: T) -> bool

source§

fn is_signaling_nan(&self) -> bool

source§

fn from_u32(x: u32, rnd: RoundingMode) -> Self

source§

fn from_u64(x: u64, rnd: RoundingMode) -> Self

source§

fn from_i32(x: i32, rnd: RoundingMode) -> Self

source§

fn from_i64(x: i64, rnd: RoundingMode) -> Self

source§

fn to_u32(&self, rnd: RoundingMode, exact: bool) -> u32

source§

fn to_u64(&self, rnd: RoundingMode, exact: bool) -> u64

source§

fn to_i32(&self, rnd: RoundingMode, exact: bool) -> i32

source§

fn to_i64(&self, rnd: RoundingMode, exact: bool) -> i64

source§

fn to_f16(&self, rnd: RoundingMode) -> F16

source§

fn to_bf16(&self, _rnd: RoundingMode) -> BF16

source§

fn to_f32(&self, _rnd: RoundingMode) -> F32

source§

fn to_f64(&self, rnd: RoundingMode) -> F64

source§

fn to_f128(&self, rnd: RoundingMode) -> F128

source§

fn round_to_integral(&self, rnd: RoundingMode) -> Self

source§

fn compare<T: Borrow<Self>>(&self, x: T) -> Option<Ordering>

source§

fn from_u8(x: u8, rnd: RoundingMode) -> Selfwhere Self: Sized,

source§

fn from_u16(x: u16, rnd: RoundingMode) -> Selfwhere Self: Sized,

source§

fn from_i8(x: i8, rnd: RoundingMode) -> Selfwhere Self: Sized,

source§

fn from_i16(x: i16, rnd: RoundingMode) -> Selfwhere Self: Sized,

source§

fn neg(&self) -> Selfwhere Self: Sized,

source§

fn abs(&self) -> Selfwhere Self: Sized,

source§

fn sign(&self) -> Self::Payload

source§

fn exponent(&self) -> Self::Payload

source§

fn fraction(&self) -> Self::Payload

source§

fn is_positive(&self) -> bool

source§

fn is_positive_zero(&self) -> bool

source§

fn is_positive_subnormal(&self) -> bool

source§

fn is_positive_normal(&self) -> bool

source§

fn is_positive_infinity(&self) -> bool

source§

fn is_negative(&self) -> bool

source§

fn is_negative_zero(&self) -> bool

source§

fn is_negative_subnormal(&self) -> bool

source§

fn is_negative_normal(&self) -> bool

source§

fn is_negative_infinity(&self) -> bool

source§

fn is_nan(&self) -> bool

source§

fn is_zero(&self) -> bool

source§

fn is_subnormal(&self) -> bool

source§

fn set_sign(&mut self, x: Self::Payload)

source§

fn set_exponent(&mut self, x: Self::Payload)

source§

fn set_fraction(&mut self, x: Self::Payload)

source§

fn positive_infinity() -> Selfwhere Self: Sized,

source§

fn positive_zero() -> Selfwhere Self: Sized,

source§

fn negative_infinity() -> Selfwhere Self: Sized,

source§

fn negative_zero() -> Selfwhere Self: Sized,

source§

fn quiet_nan() -> Selfwhere Self: Sized,

source§

impl Copy for BF16

Auto Trait Implementations§

§

impl RefUnwindSafe for BF16

§

impl Send for BF16

§

impl Sync for BF16

§

impl Unpin for BF16

§

impl UnwindSafe for BF16

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.