Skip to content

Proper handling of uint64 #18

Closed
wants to merge 4 commits into from

4 participants

@karlseguin

No description provided.

@karlseguin

You get it out as a Number, which isn't as large as a uint64, but it's much larger than the current implementation. So it still fails for very large numbers...but it won't fail on say 2^34 like it currently does. I'd have to read the JS specs again to see what the limit is..it's much closer to 2^64 than not.

@ronkorving

Well, JS just uses double procession floats, right? There is no integer type, as far as I know. So you can get pretty close to 2^64, but you lose precision at the higher ranges.

Math.pow(2, 60) == Math.pow(2, 60)-1;

This yields true.

@godsflaw
Collaborator

This pull request is super old, and will not merge cleanly. Also, since javascript does uint64 completely wrong, it might be best to build in a bigint style dependency and have msgpack use that. Getting "close" to uint64 just isn't good enough. Perhaps integrating this is the solution: https://github.com/broofa/node-int64

@godsflaw godsflaw closed this Jun 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.