In Ruby:
-1104507 ^ 3965973030 => -3966969949
In Javascript:
-1104507 ^ 3965973030 => 327997347
Someone asked a similar question here but the answer just pointed to a wrapper for Closure. I need a way to get the same answers from Ruby as I get for JavaScript so I can port this code over.
I need a way of being able to get the JavaScript result from any A ^ B
in Ruby for any integers A
and B
.