-
Notifications
You must be signed in to change notification settings - Fork 192
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
decode ints as float64 #152
Comments
@imbstack, I guess JS clients have to rely on JSON format until this issue is resolved. |
Use On Wed, Apr 13, 2016 at 3:02 PM, Jonas Finnemann Jensen <
|
(Or, rather, instead a float64.) On Wed, Apr 13, 2016 at 3:07 PM, Philip Hofer [email protected] wrote:
|
Hmm, that could work, but it adds a lot of complexity inside my application and prevents the same struct from working with ffjson... Is casting int8,... to float64 really a problem. Thanks for the hint... |
The snippet in #134 (comment) I'm not suggesting that decoding an Note: I think this is worth considering, as I get the impression that msgpack is intended as drop-in replacement for JSON. Which it won't be if the wire representation implies semantics. |
I believe he was referring to CBOR in that comment, not to msgpack. But as for casting, see #143. I put the pull request out there a while ago and didn't see much interest. |
I get
msgp: attempted to decode type "int" with method for "float64"
Server has an
float64
and client is a node sending a number... I guess the node library encodes the number as an int to get the smallest possible wire format.Clearly, int8, int16, int32 can all be decoded to a float64. I know this because js always uses double (float64) which is precise up-to 53bits. Hence, it can hold both int8, int16, and int32.
The text was updated successfully, but these errors were encountered: