I'm trying to do some multiplications and divisions with 64 bit integers. I want my results to have 64 bit, any overflow should be truncated. I've managed to get it working with multiplications:
z = 0xed5c6911
y = 0xFFFFFFFF & (z * 33)
print hex(z)
print hex(y)
This outputs:
0xed5c6911
0x98e98b31
as expected.
I would like to reverse this now:
z = 0xFFFFFFFF & (y / 33)
print hex(z)
I would expect 0xed5c6911
, the original value of z
, but I am getting 0x4a23a85
.
How can I reverse the operation done in the first snippet and retrieve the original value of z
from y
?