I'm having a python code that uses the number 2637268776
(bigger than sys.maxint
in 32-bit systems). Therefore it is saved as a long
type.
I'm using a C++ framework bindings in my code, so I have a case where it's being converted into int32
, resulting in an int32 overflow:
2637268776 --> -1657698520
In my case, it can happen only one time, so it's safe to assume that if the integer is negative, we had a single int overflow. How can I mathematically reverse the numbers?