F
fred.l.kleinschmidt
If one knows that x and y are unsigned integers (of unknown size -
they may be short, int, long, long long), what is the most portable
way to determine their difference?
If x is smaller than y, then x-y is negative.
A naive approach is
if ( x > y ) {
...
}
but a compiler may code (x>y) as (x-y > 0).
they may be short, int, long, long long), what is the most portable
way to determine their difference?
If x is smaller than y, then x-y is negative.
A naive approach is
if ( x > y ) {
...
}
but a compiler may code (x>y) as (x-y > 0).