Menu
  • HOME
  • TAGS

What is the maximum integer it is safe to use in a Javascript bitmask flag value?

javascript,bitmask,bit-masks

The value range is a complete 32-bit value, ie. 0 to 0xffffffff (or 232-1). If it will be signed or not depends. If it will be signed initially then this will produce -1: document.write(0xffffffff>>0); But you can use unsigned values too which means the range is [0, 4294967295]: document.write(0xffffffff>>>0); The...