pub trait FloatConvert<T: Float>: Float {
// Required method
fn convert_r(self, round: Round, loses_info: &mut bool) -> StatusAnd<T>;
// Provided method
fn convert(self, loses_info: &mut bool) -> StatusAnd<T> { ... }
}Expand description
Convert between floating point types.
Required Methods§
Sourcefn convert_r(self, round: Round, loses_info: &mut bool) -> StatusAnd<T>
fn convert_r(self, round: Round, loses_info: &mut bool) -> StatusAnd<T>
Convert a value of one floating point type to another. The return value corresponds to the IEEE754 exceptions. *loses_info records whether the transformation lost information, i.e. whether converting the result back to the original type will produce the original value (this is almost the same as return value==Status::OK, but there are edge cases where this is not so).
Provided Methods§
Sourcefn convert(self, loses_info: &mut bool) -> StatusAnd<T>
fn convert(self, loses_info: &mut bool) -> StatusAnd<T>
Convert with default NearestTiesToEven rounding.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".