[][src]Struct simple_soft_float::FloatProperties

pub struct FloatProperties { /* fields omitted */ }

properties of a particular floating-point format

Methods

impl FloatProperties[src]

pub fn check_compatibility(
    self,
    other: Self
) -> Result<(), FloatPropertiesIncompatible>
[src]

check for compatibility between two FloatProperties values

pub const fn new_with_extended_flags(
    exponent_width: usize,
    mantissa_width: usize,
    has_implicit_leading_bit: bool,
    has_sign_bit: bool,
    platform_properties: PlatformProperties
) -> Self
[src]

create a new FloatProperties value

pub const fn new(exponent_width: usize, mantissa_width: usize) -> Self[src]

create a new FloatProperties value

pub const fn new_with_platform_properties(
    exponent_width: usize,
    mantissa_width: usize,
    platform_properties: PlatformProperties
) -> Self
[src]

create a new FloatProperties value

pub const STANDARD_16: Self[src]

FloatProperties for standard binary16 format

pub const STANDARD_32: Self[src]

FloatProperties for standard binary32 format

pub const STANDARD_64: Self[src]

FloatProperties for standard binary64 format

pub const STANDARD_128: Self[src]

FloatProperties for standard binary128 format

pub const fn standard_16_with_platform_properties(
    platform_properties: PlatformProperties
) -> Self
[src]

FloatProperties for standard binary16 format

pub const fn standard_32_with_platform_properties(
    platform_properties: PlatformProperties
) -> Self
[src]

FloatProperties for standard binary32 format

pub const fn standard_64_with_platform_properties(
    platform_properties: PlatformProperties
) -> Self
[src]

FloatProperties for standard binary64 format

pub const fn standard_128_with_platform_properties(
    platform_properties: PlatformProperties
) -> Self
[src]

FloatProperties for standard binary128 format

pub fn standard_with_platform_properties(
    width: usize,
    platform_properties: PlatformProperties
) -> Option<Self>
[src]

construct FloatProperties for standard width-bit binary interchange format, if it exists

pub fn standard(width: usize) -> Option<Self>[src]

construct FloatProperties for standard width-bit binary interchange format, if it exists

pub fn is_standard(self) -> bool[src]

check if self is a standard binary interchange format.

pub const fn exponent_width(self) -> usize[src]

the number of bits in the exponent field

pub const fn mantissa_width(self) -> usize[src]

the number of bits in the mantissa field (excludes any implicit leading bit)

pub const fn has_implicit_leading_bit(self) -> bool[src]

if the floating-point format uses an implicit leading bit

pub const fn has_sign_bit(self) -> bool[src]

if the floating-point format has a sign bit

pub const fn platform_properties(self) -> PlatformProperties[src]

get the PlatformProperties

pub fn quiet_nan_format(self) -> QuietNaNFormat[src]

get the QuietNaNFormat

pub const fn width(self) -> usize[src]

get the floating-point format's width in bits

pub const fn fraction_width(self) -> usize[src]

get the number of bits after the radix point in the representation of normal floating-point values

pub const fn sign_field_shift(self) -> usize[src]

get the amount by which the floating-point bits should be shifted right in order to extract the sign field.

the sign field can be extracted using (bits & sign_field_mask) >> sign_field_shift

pub fn sign_field_mask<Bits: FloatBitsType>(self) -> Bits[src]

get the bitwise mask for the sign field (before shifting to extract).

the sign field can be extracted using (bits & sign_field_mask) >> sign_field_shift

pub const fn exponent_field_shift(self) -> usize[src]

get the amount by which the floating-point bits should be shifted right in order to extract the exponent field.

the exponent field can be extracted using (bits & exponent_field_mask) >> exponent_field_shift

pub fn exponent_field_mask<Bits: FloatBitsType>(self) -> Bits[src]

get the bitwise mask for the exponent field (before shifting to extract).

the exponent field can be extracted using (bits & exponent_field_mask) >> exponent_field_shift

pub const fn mantissa_field_shift(self) -> usize[src]

get the amount by which the floating-point bits should be shifted right in order to extract the mantissa field.

the mantissa field can be extracted using (bits & mantissa_field_mask) >> mantissa_field_shift

pub fn mantissa_field_mask<Bits: FloatBitsType>(self) -> Bits[src]

get the bitwise mask for the mantissa field (before shifting to extract).

the mantissa field can be extracted using (bits & mantissa_field_mask) >> mantissa_field_shift

pub fn mantissa_field_max<Bits: FloatBitsType>(self) -> Bits[src]

get the maximum value of the mantissa field

pub fn mantissa_field_normal_min<Bits: FloatBitsType>(self) -> Bits[src]

get the minimum value the mantissa field can take on for normal floating-point numbers.

pub const fn mantissa_field_msb_shift(self) -> usize[src]

get the amount by which the floating-point bits should be shifted right in order to extract the mantissa field's MSB.

the mantissa field's MSB can be extracted using (bits & mantissa_field_msb_mask) >> mantissa_field_msb_shift

pub fn mantissa_field_msb_mask<Bits: FloatBitsType>(self) -> Bits[src]

get the bitwise mask for the mantissa field's MSB (before shifting to extract).

the mantissa field's MSB can be extracted using (bits & mantissa_field_msb_mask) >> mantissa_field_msb_shift

pub fn exponent_bias<Bits: FloatBitsType>(self) -> Bits[src]

get the amount by which the exponent field is offset from the mathematical exponent for normal floating-point numbers.

the mathematical exponent and the exponent field's values for normal floating-point numbers are related by the following equation: mathematical_exponent + exponent_bias == exponent_field

pub fn exponent_inf_nan<Bits: FloatBitsType>(self) -> Bits[src]

get the value used in the exponent field for infinities and NaNs

pub fn exponent_zero_subnormal<Bits: FloatBitsType>(self) -> Bits[src]

get the value used in the exponent field for zeros and subnormals

pub fn exponent_min_normal<Bits: FloatBitsType>(self) -> Bits[src]

get the minimum value of the exponent field for normal floating-point numbers.

the mathematical exponent and the exponent field's values for normal floating-point numbers are related by the following equation: mathematical_exponent + exponent_bias == exponent_field

pub fn exponent_max_normal<Bits: FloatBitsType>(self) -> Bits[src]

get the maximum value of the exponent field for normal floating-point numbers.

the mathematical exponent and the exponent field's values for normal floating-point numbers are related by the following equation: mathematical_exponent + exponent_bias == exponent_field

pub fn overall_mask<Bits: FloatBitsType>(self) -> Bits[src]

get the mask for the whole floating-point format

Trait Implementations

impl Clone for FloatProperties[src]

impl Copy for FloatProperties[src]

impl Debug for FloatProperties[src]

impl Eq for FloatProperties[src]

impl FloatTraits for FloatProperties[src]

type Bits = BigUint

the type used to represent bits for a floating-point format

impl Hash for FloatProperties[src]

impl PartialEq<FloatProperties> for FloatProperties[src]

impl StructuralEq for FloatProperties[src]

impl StructuralPartialEq for FloatProperties[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.