I can compute this easily in the case that $xy < 2^{64}$. But I'm not sure how to do this if $xy \geq 2^{64}$.
I know that $\lfloor \frac{xy}{z} \rfloor = \frac{xy - (xy\ \text{mod} \ z)}{z}$, but I'm not sure where to go from there.
I can compute this easily in the case that $xy < 2^{64}$. But I'm not sure how to do this if $xy \geq 2^{64}$.
I know that $\lfloor \frac{xy}{z} \rfloor = \frac{xy - (xy\ \text{mod} \ z)}{z}$, but I'm not sure where to go from there.
Use two integers to represent one integer. Assume you are using c/c++. You can use a struct that has two long long unsigned integers to represent $x$, $y$ and $z$. So you can express $x = 2^{32}x_1+x_2$ with $x_1$ being a nonnegative integer smaller than $2^{32}$ and $x_2$ being a nonnegative integer not greater than $2^{32}$. I would assume you will know the rest.
Or you can choose to use some libraries or built-in classes. For example, you can use BigInteger class in Java.
(It goes without saying that you will not have these problems if you were using Python, Ruby, etc.)
Split $x = 2^{32} \cdot x_{hi} + x_{lo}$, $y = 2^{32} \cdot y_{hi} + y_{lo}$. Then
$x \cdot y = 2^{64} \cdot x_{hi}\cdot y_{hi} + 2^{32} \cdot x_{hi}\cdot y_{lo} + 2^{32} \cdot x_{lo}\cdot y_{hi} + x_{lo}\cdot y_{lo}$. You can easily calculate each of these products except for the factor $2^{32}$ or $2^{64}$.
You split the products $x_{hi}\cdot y_{lo}$ and $x_{lo}\cdot y_{hi}$ into higher and lower 32 bits and add up the components.