Reputation: 23606
Assuming I have 2 variables:
uint64_t a = ...
uint32_t b = ...
Will comparing the integers yield the expected results, i.e. (a != b)
, or (b > a)
?
Upvotes: 18
Views: 4359
Reputation: 16168
Short answer - yes. The 'smaller' is converted to bigger one before comparison.
Upvotes: 8
Reputation:
No problem. The compiler promotes the 32-bit to 64-bit before the comparison
Upvotes: 27