Answer the question
In order to leave comments, you need to log in
What mathematical operations does this code perform?
There is JavaScript code:
function o(e) {
var t = arguments.length
, n = e & 65535
, r = e >> 16;
for (var i = 1; i < t; i++) {
var s = arguments[i];
n += s & 65535,
r += (s >> 16) + (n >> 16),
n &= 65535
}
return r << 16 | n & 65535
}
Answer the question
In order to leave comments, you need to log in
they are logical and bitwise operations.
| - logical addition
& - logical multiplication
<< and >> - shift left or right by the number of bits, similar to multiplying or dividing by 2 to the specified degree
specifically how &
y = x & 65535
for x=12345
translate into binary form
11000000111001
translate 65535 there
1111111111111111
perform logical bitwise addition (look for the rules yourself)
result = 10011000000111000
translate back into decimal form
77880 something
like this)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question