I need to compute an expression which looks like: A*B - C*D, where their types are: signed long long int A, B, C, D; Each number can be really big (not
A*B - C*D
signed long long int A, B, C, D;
For the sake of completeness, since no one mentioned it, some compilers (e.g. GCC) actually provide you with a 128 bit integer nowadays.
Thus an easy solution could be:
(long long)((__int128)A * B - (__int128)C * D)