pub trait APFloatType: Type + FloatTypeInterface {
// Required methods
fn value_to_f64(&self, val: APFloat) -> f64;
fn value_from_f64(&self, val: f64) -> APFloat;
fn value_to_string(&self, val: APFloat) -> String;
fn disp_value(
&self,
val: APFloat,
ctx: &Context,
state: &State,
f: &mut Formatter<'_>,
) -> Result;
fn parse_value<'a>(
&self,
state_stream: &mut StateStream<'a>,
) -> ParseResult<'a, APFloat>;
// Provided method
fn verify(_op: &dyn Type, _ctx: &Context) -> Result<()>
where Self: Sized { ... }
}Required Methods§
fn value_to_f64(&self, val: APFloat) -> f64
fn value_from_f64(&self, val: f64) -> APFloat
fn value_to_string(&self, val: APFloat) -> String
fn disp_value( &self, val: APFloat, ctx: &Context, state: &State, f: &mut Formatter<'_>, ) -> Result
fn parse_value<'a>( &self, state_stream: &mut StateStream<'a>, ) -> ParseResult<'a, APFloat>
Provided Methods§
Trait Implementations§
impl TypeImplsInterface<dyn APFloatType> for Float64Type
impl TypeImplsInterface<dyn APFloatType> for Float32Type
impl TypeImplsInterface<dyn APFloatType> for TFloat32Type
impl TypeImplsInterface<dyn APFloatType> for FloatFlex32Type
impl TypeImplsInterface<dyn APFloatType> for Float16Type
impl TypeImplsInterface<dyn APFloatType> for BFloat16Type
impl TypeImplsInterface<dyn APFloatType> for Float8E5M2Type
impl TypeImplsInterface<dyn APFloatType> for Float8E4M3Type
impl TypeImplsInterface<dyn APFloatType> for Float4E2M1Type
impl TypeImplsInterface<dyn APFloatType> for Float8E8M0Type
impl TypeInterfaceMarker for dyn APFloatType
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl APFloatType for BFloat16Type
impl APFloatType for Float4E2M1Type
impl APFloatType for Float8E4M3Type
impl APFloatType for Float8E5M2Type
impl APFloatType for Float8E8M0Type
IeeeFloat::from_bits assumes the presence of a sign bit and will overflow when extracting this
non-existent bit. So we need to do custom conversion here.