Unsigned integer

Revision en2, by avik26091998, 2017-10-08 13:54:31

Why do unsigned integers wrap without extensively using the modulo operator in c++?? Suppose , Unsigned int a , b; a and b both are 2^32-1. Then what will be the value of a+b?

so if they don't overflow how can we make them overflow??

Tags unsigned int

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English avik26091998 2017-10-08 13:54:31 13 Tiny change: ' both are greater than 2^32-1.\n' -> ' both are 2^32-1.\n'
en1 English avik26091998 2017-10-08 11:47:07 270 Initial revision (published)