Skip to content

Bitshift performance vs 64bit numbers #109

New issue

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

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

Already on GitHub? # to your account

Closed
bc99 opened this issue Nov 13, 2013 · 4 comments
Closed

Bitshift performance vs 64bit numbers #109

bc99 opened this issue Nov 13, 2013 · 4 comments

Comments

@bc99
Copy link

bc99 commented Nov 13, 2013

Every number is stored with 64bit, except you are doing bit shifting. Then javascript stores the number into a 32bit integer. The result of this: You get negative or just wrong numbers when you are shifting a big js-representing integer.
If you really think bit shift is a good way to improve performance, make sure the numbers are not bigger than 32 bit.

@serbanghita
Copy link

@tbcm interesting, maybe you should provide some examples for the guide

@bc99
Copy link
Author

bc99 commented Nov 14, 2013

I had found a good website about this a few weeks ago, because I ran into this issue. I cannot find it anymore, but here is a stackoverflow link:
http://stackoverflow.com/questions/2373791/bitshift-in-javascript

At the moment I'm very busy, so I cannot create an example. I just thought it would be good to know.

@hshoff
Copy link
Member

hshoff commented Nov 14, 2013

Ah! Thanks for pointing this out. 🍻

@hshoff hshoff closed this as completed in 8bab767 Nov 14, 2013
@serbanghita
Copy link

🍻 thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants