#include void testmuli(long a, long b, long ab) { assert (a * b == ab); } void testmulu(unsigned long a, unsigned long b, unsigned long ab) { assert (a * b == ab); } void testmulub(unsigned long a, unsigned char b, unsigned long ab) { assert (a * b == ab); assert (b * a == ab); } void testmulbu(unsigned char a, unsigned long b, unsigned long ab) { assert (a * b == ab); assert (b * a == ab); } void testdivi(long a, long b, long ab) { assert (a / b == ab); } void shltesti(long a, long b, long ab) { assert (a << b == ab); } void shrtesti(long a, long b, long ab) { assert (a >> b == ab); } void testmuldiv(unsigned long a, unsigned long b) { unsigned long c = a * b; if (a != 0) { assert(c / a == b); assert(c % a == 0); } if (b != 0) { assert(c / b == a); assert(c % b == 0); } } long sieve(long size) { bool sieve[1000]; for(long i=0; i> i, q >> (31 - i)); testmuldiv(q >> i, p >> (31 - i)); } return 0; }