Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow forcing floats to be encoded as F32 #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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?

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