When comparing a type larger than int
, with an integer constant, should I place the constant on the left or the right to ensure the correct comparison is performed?
int64_t i = some_val;
if (i == -1)
or should it be:
if (-1 == i)
Are there any circumstances in which either case is not identical to comparison with -1LL
(where int64_t
is long long
)?