Previously the f32 as f64 would produce a nondeterministic sign, as I found out in https://github.com/rust-lang/miri/issues/3139. This would then get leaked by as_f64() or by serialization of the Number. It doesn't make a difference when serializing to YAML, but we support serializing serde_yaml::Number to TOML and other formats, where it does.
YAML only has one NaN, so even negative NaNs serialize to .nan in YAML. It seems fine to discard the original sign in serde_yaml::Number too.
Previously the
f32 as f64
would produce a nondeterministic sign, as I found out in https://github.com/rust-lang/miri/issues/3139. This would then get leaked byas_f64()
or by serialization of theNumber
. It doesn't make a difference when serializing to YAML, but we support serializingserde_yaml::Number
to TOML and other formats, where it does.YAML only has one NaN, so even negative NaNs serialize to
.nan
in YAML. It seems fine to discard the original sign inserde_yaml::Number
too.