Make definition of Float type clear#200
Conversation
MessagePack type system has not defined error margin of Float type. A clear thing is that the type system does not distinguish single-precision from double-precision and double-precision is the finest precision. However, some applications need to be aware about precision especially when they compare a serialized floating point numbers with values comming from other data sources. This change makes it clear that MessagePack type system does not preserve size of error margin, and it uses IEEE 754 double-precision.
|
Doesn't this spec include any SHOULD or RECOMMENDED to handle Float type in each implementations? |
|
@frsyuki, Do you mean that every Float32/Float64 should be deserialized into a double-precision Float, and every double-precision Float should be serialized into the smallest representation (Float32 or Float64) that retains the precision of that value? Also, what do you mean by define an "error margin" of the Float type? Error between a more compact Float32 representation and the Float64 representation of the same value? Finally, I'm not sure I understand your comment: That seems to imply that the serialization should preserve the application's intended precision for a data type, e.g. if it was serialized as Float32, then it should be deserialized as a single-precision float. |
MessagePack type system has not defined error margin of Float type.
A clear thing is that the type system does not distinguish
single-precision from double-precision and double-precision is the
finest precision.
However, some applications need to be aware about precision especially
when they compare a serialized floating point numbers with values
comming from other data sources.
This change makes it clear that MessagePack type system does not
preserve size of error margin, and it uses IEEE 754 double-precision.