Home > Web Front-end > JS Tutorial > body text

JavaScript unsigned right shift operator_Basic knowledge

WBOY
Release: 2016-05-16 18:53:54
Original
1408 people have browsed it

Usage example

result = expression1 >>> expression2

where result is any variable.
expression1 is any expression.
expression2 is any expression.

Explanation of unsigned right shift operator in JavaScript
>>> operator shifts each bit of expression1 to the right by the number of digits specified by expression2. After the right shift, the vacated bits on the left are filled with zeros. Bits shifted out to the right are discarded. For example:
var temp
temp = -14 >>> 2

The value of variable temp is -14 (i.e. binary 11111111 11111111 11111111 11110010), which is equal to 1073741820 after shifting two places to the right ( That is, binary 00111111 11111111 11111111 11111100).

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!