how to compute that a*b > c*d and store a value for later comparison with any other two pairs. The product is overflowed during multiplication in c++.
long long a = 12345678912, b=45697845821, c=47896512354, d=741258963256;
You can cast to float and compare a/d and c/b. Alternatively you can stay with ints and if a/d == c/b then you compare a%d and c%b.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With