1

In javascript:

var zx=1566202383
var xz=1
document.write(zx << xz | zx >>> 32 - xz)

result is -1162562530

In python (i used - How to get the logical right binary shift in python):

zx=1566202383
xz=1
def rshift(val, n): 
    return val>>n if val >= 0 else (val+0x100000000)>>n

print (zx << xz | rshift(zx, 32 - xz)) 

result is: 3132404766

So, how to get the same result in python, like in javascript?

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.