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
Hi. I'm trying to serialize f16, but I'm stuck on it.
I'm using serde feature, but when I use f16_var.serialize(serializer) I'm getting unexpected results.
Currently f16 is being serialized as a u16, which works for binary formats, but not so much for string serialization. Will just need to do custom serialization implementation rather then using derive.
Added serde adapters to support this, since serde has design limitations preventing different serialization for different output formats. Use #[serde(serialize_with="f16::serialize_as_f32")] in derive macros of types containing f16 to see float values in JSON or other string output formats.
Hi. I'm trying to serialize f16, but I'm stuck on it.
I'm using
serde
feature, but when I usef16_var.serialize(serializer)
I'm getting unexpected results.Example:
Value: 1.0
Serialization result: "15360"`
If I convert the value to f32 and serialize it, everything is fine, I will get "1.0"` as expected.
Running on Ubuntu 20 under WSL
The text was updated successfully, but these errors were encountered: