msgpack-java icon indicating copy to clipboard operation
msgpack-java copied to clipboard

Documentation ... (float / double)

Open potyt opened this issue 9 years ago • 1 comments

I think there must be some documentation that I just can't find hiding somewhere.

If I pack a float, it seems it gets packed as a float value, and I guess I unpack it as such as well. Now, for a double, is this a FloatValue as well, or a NumberValue (we already have IntegerValue). If a double gets packed via the FloatValue type, then when unpacking it how do I know if it is single or double precision on the far end, or is everything upscaled to double precision?

Is this the same for int/long as well? If so, and FloatValue represents floats and doubles and IntegerValue represents Integers and Longs, then what is NumberValue for, (perhaps BigInteger, but then again this is a custom type that shouldn't be handled directly by something like msgpack, or where does it stop, native support for Date, Complex,....?)

No doubt it all makes sense when you know how, it is just there doesn't seem to be a way to really know how without reading all of the source code.

All of this was remarkably easy to understand and to use previously (v0.6.8), in fact, none of it really mattered. If there were implementation fixes that could make things more efficient, then that's great, but what was the driver for changing the public API? It would seem to me to be a fairly big step backwards (with reference to this and other issues I raised #316 #317.)

potyt avatar Jan 01 '16 23:01 potyt

/**

  • Representation of MessagePack's Float type.
  • MessagePack's Float type can represent IEEE 754 double precision floating point numbers including NaN and infinity. This is same with Java's {@code double} type.
  • @see org.msgpack.value.NumberValue */

helloyokoy avatar Nov 22 '17 02:11 helloyokoy