difference between JavaScript bit-wise operator code and Python bit-wise operator code

后端 未结 2 620
余生分开走
余生分开走 2021-01-13 05:44

I have converted JavaScript code which uses bit-wise operators in that code to Python code, but there is one problem when i do this in JavaScript and Python

         


        
2条回答
  •  轮回少年
    2021-01-13 06:41

    If you want the JavaScript equivalent value then what you can do is :

    import ctypes
    
    print(ctypes.c_int(424970184 << 10 ^ 0).value)
    

    Output:

    1377771520
    

提交回复
热议问题