Comments (1)
It is intentional design. See #1070 and #1017.
Regarding the spec, I interpreted the following such that for "an object of a certain source type, serializers SHOULD use the format among the formats for that specific source type which represents the data in the smallest number of bytes."
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.
We don't assume certain source type.
If you want to enforce float packing, you can create PR for that.
I think that pack_fix_int64()
is a good example:
msgpack-c/include/msgpack/v1/pack.hpp
Lines 821 to 828 in e9e06a5
It always use MessagePack 64bit signed integer format even if the value is not require 64bit.
Similarlly, you can add pack_fix_float()
and pack_fix_double()
.
When you would create the PR, please add tests too.
Test code locations are after
msgpack-c/test/msgpack_basic.cpp
Lines 148 to 200 in e9e06a5
and
msgpack-c/test/msgpack_basic.cpp
Lines 238 to 294 in e9e06a5
from msgpack-c.
Related Issues (20)
- Detect msgpack-cxx <= 6.0.0 with cmake HOT 10
- The dynamic library generated has wrong version HOT 1
- A new release HOT 2
- missing sysdep.h, pack_template.h, predef.h and predef folder in msgpck-c HOT 2
- Unable to unpack extension with `UINT32_MAX` bytes of data HOT 4
- Unpacking float32 does not preserve signaling NaN, unlike float64 HOT 10
- Cannot convert vector<int> to variant HOT 1
- Deploy `msgpack-cxx` package to platform-independent package repository
- How to compile msgpack-c on linux to use with mingw to cross compile apps for windows
- Memory cleaned up multiple times
- URGENT: Wiki security issue HOT 3
- Unpack example from quickstart segfaults HOT 3
- Question, when packing, are the values already supposed to be in big endian HOT 2
- JSON-like API? HOT 1
- msgpack incorrectly deserializes a std::map to std::multimap HOT 2
- [Question/Discussion] msgpack is much slower than Boost.JSON HOT 7
- find_package Ignoring Boost_ROOT Due to Unset CMP0074 Policy
- someting about msgpack::object.convert() HOT 1
- Where can i find `msgpack` library?? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msgpack-c.