Page 157 - JavaScript
P. 157

Right Shift (Zero fill)



        The zero-fill right shift operator (value) >>> (shift amount) will move the bits to the right, and the
        new bits will be 0's. The 0's are shifted in from the left, and excess bits to the right are shifted off
        and discarded. This means it can make negative numbers into positive ones.


         -30 >>> 2 => 1073741816
         //       -30:      111..1100010
         //1073741816:      001..1111000


        Zero-fill right shift and sign-propagating right shift yield the same result for non negative numbers.

        Read Bitwise operators online: https://riptutorial.com/javascript/topic/3494/bitwise-operators






































































        https://riptutorial.com/                                                                             114
   152   153   154   155   156   157   158   159   160   161   162