Why a positive number operated with bitwise or 0 not always positive in Javascript
For example:
3391700000|0
-903267296
4260919000|0
-34048296
2884900000|0
-1410067296
I'm using chrome 64-bit on Linux
related to: https://stackoverflow.com/a/12837315/1620210
Because JavaScript uses 32bit integers at most, but keep in mind every number is kind of a float in this language
If you want to truncate them to an unsigned 32bit value:
(3391700000|0) >>> 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With