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
Given that JS has no way to clarify int vs float values, I would like to see the addition of a Float class to msgpack so that a developer could explicitly state a number is in fact a float, event if the value itself can be interpreted as an int.
As a bonus, it would be nice to accept a Long value as well so that one does not have to manually pass in Int-64 objects.
The addition of these two class types would give developers control over the family used to encode their values. The existing number support can stay for backwards compatibility.
The text was updated successfully, but these errors were encountered:
When msgpack-lite encodes a
number
primitive type, the actual encoded value will be either in the Int family or the Float family. While the msgpack spec does allow for serializing to the smallest-possible type in a given family, it doesn't allow for crossing over to another family. See https://github.com/msgpack/msgpack/blob/master/spec.md#serialization-type-to-format-conversionGiven that JS has no way to clarify int vs float values, I would like to see the addition of a Float class to msgpack so that a developer could explicitly state a number is in fact a float, event if the value itself can be interpreted as an int.
As a bonus, it would be nice to accept a Long value as well so that one does not have to manually pass in Int-64 objects.
The addition of these two class types would give developers control over the family used to encode their values. The existing
number
support can stay for backwards compatibility.The text was updated successfully, but these errors were encountered: