开发者

How to deal with unsigned numbers in JavaScript?

开发者 https://www.devze.com 2023-03-28 23:45 出处:网络
I am having difficult time dealing with unsigned numbers in JavaScript. I would like to perform basic math and bitwise operation on unsigned numbers using开发者_如何学运维 JavaScript especially shifti

I am having difficult time dealing with unsigned numbers in JavaScript. I would like to perform basic math and bitwise operation on unsigned numbers using开发者_如何学运维 JavaScript especially shifting bits. Anyone have suggestions how to deal with unsigned numbers in JavaScript?

Example: Shifting 0x40000000 to the left gives you a negative number rather than 0x80000000

0

精彩评论

暂无评论...
验证码 换一张
取 消