Menu
I have run into a snag with the JavaScript ^ operator for a calculation that I need to do in parallel in Delphi and in JS. Here is an example. Take two numbers
0xD9 11011001
0x9E3779B9 10011110001101110111100110111001
Delphi gives 9E377960
10011110001101110111100101100000 – the result I expect.
Javascript gives
-1640531616 = 1111111111111111111111111111111110011110001101110111100101100000
Could anyone shed some light on this mystery and suggest a way to get both Delphi and JS to behave in the same way? I would be most obliged for any help.