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

32 bit floating point #94

Open
bQvle opened this issue Jul 15, 2018 · 2 comments
Open

32 bit floating point #94

bQvle opened this issue Jul 15, 2018 · 2 comments

Comments

@bQvle
Copy link

bQvle commented Jul 15, 2018

Is it possible to encode as 32 bit floating points instead of 64?

I'm sending a lot of floating number over a socket and this seems quiet expensive.

1.1 = [203, 63, 241, 153, 153, 153, 153, 153, 154]

@mattbishop
Copy link

This is actually correct behaviour because 1.1 is a double-precision float value, which is 64 bits. You can see in the Node REPL:

> Math.fround(1.1)
1.100000023841858

@thatcort
Copy link

I'd also like to be able to force 32-bit float encoding. Is this possible?

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

No branches or pull requests

3 participants