You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to introduce lossless TryFrom implementations for bf16 and f16 types from Rust primitive f32 and f64 types so that for example f16::try_from(value).map(f16::to_f32) is either Err or Ok(value2) with value == value2 for all possible values?
This means that if TryFrom is Ok the conversion was lossless and it is possible to fully recover the f32 or f64 value later on if no mutations happen in between. If TryFrom yields Err then it is not possible to losslessly convert the particular f32 or f64 value. No rounding shall take place.
I actually need this if this can be implemented efficiently. :)
The text was updated successfully, but these errors were encountered:
Would it be possible to introduce lossless
TryFrom
implementations forbf16
andf16
types from Rust primitivef32
andf64
types so that for examplef16::try_from(value).map(f16::to_f32)
is eitherErr
orOk(value2)
withvalue == value2
for all possiblevalue
s?This means that if
TryFrom
isOk
the conversion was lossless and it is possible to fully recover thef32
orf64
value later on if no mutations happen in between. IfTryFrom
yieldsErr
then it is not possible to losslessly convert the particularf32
orf64
value. No rounding shall take place.I actually need this if this can be implemented efficiently. :)
The text was updated successfully, but these errors were encountered: