V
V
Vyacheslav Mezentsev2016-03-22 13:23:39
C++ / C#
Vyacheslav Mezentsev, 2016-03-22 13:23:39

How to store double in MsgPack?

The specification says that:

If an object can be represented in multiple possible output formats, serializers SHOULD use the format which represents the data in the smallest number of bytes.

Does this apply to the float family of types? I've seen C++ implementations where double is written as double and float as float, regardless of the value of the number.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AtomKrieg, 2016-03-22
@AtomKrieg

It seems to me that the recommendation from the captain is written in the specification. If your values ​​fit in the range 0-255, then it is better to use uint8, not uint64 format, similarly with real values ​​​​(which are float32 and float64)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question