I have this piece of javascript code that I am trying to understand
return ( n >>> 0 ) * 2.34e10;
So what does >>> mean?
And thanks in advance … this is my first question on SO
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s a zero-fill right shift. This won’t do anything to positive whole numbers or 0, but it does funny things on negative numbers (because the most significant bit changes to zero).
It should be noted (thanks Andy!) that bit shifting in JavaScript converts the arguments to signed 32-bit integers before doing the shifting. Therefore
>>> 0essentially does aMath.flooron positive numbers: