c语言负数取余问题

 printf("%d\r\n ",(-31)%32);			//-31
 printf("%d\r\n ",((-31)%32)>>3);		//-4
 printf("%d\r\n ",(-32)%32);			//0
 printf("%d\r\n ",((-32)%32)>>3);		//0
 printf("%d\r\n ",(-33)%32);			//-1
 printf("%d\r\n ",((-33)%32)>>3);		//-1
-31
 -4
 0
 0
 -1
 -1

你可能感兴趣的:(c语言)