Closed paupino closed 9 months ago
Hmm - this is an interesting side effect. Will need to look into this. There is a test failing when both serde-str
and serde-float
are enabled (which is not recommended for use with bincode
).
I have a longer term approach for richer (de)serialization support via policies, however for the meantime this is unfortunately a supported combination I'll need to investigate.
If, for some reason, you also have
serde-float
enabled then this will usedeserialize_f64
as a type hint. Because converting tof64
loses precision, it's highly recommended that you do NOT enable this feature when working withbincode
. That being said, this will only use 8 bytes so is slightly more efficient in terms of storage size.
Fixes #624
When performing a conversion from
Decimal
tof64
we would perform a round as the last step to remove any approximations that may have crept in during conversion. This works fairly well when there is a fractional component however is completely unnecessary when the number only has an integral component.This removes the need to round if dealing with no fractional part.