Skip to content

Conversation

jackprice
Copy link

This merge allows users to force floats to be encoded as 32-bit floats (float 32) rather than the default 64-bit doubles. This would primarily be useful for reducing the storage size of the packed result, and has no effect on unpacking, aside from the loss in precision that will happen transparently.

If there is appetite for this and this fits with style/structure expected I will expand to allow similarly forcing int8,int16 etc.

I've implemented this as an option on the packer class, but also as an ini flag (though I'm unsure if that's actually useful).

@m6w6
Copy link
Collaborator

m6w6 commented Feb 19, 2025

👍 LGTM; test cases are a bit suspicious; anything better to do there?

@jackprice
Copy link
Author

👍 LGTM; test cases are a bit suspicious; anything better to do there?

Awesome, thanks! I just basically mirrored some existing tests, what would you prefer?

@m6w6 m6w6 merged commit d514428 into msgpack:master Aug 26, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants