Your challenge this week is to implement basic arithmetic for a different type of number representation. Instead of each bit representing a power of 2, each bit will represent a number. Only one bit will be set in any integer. The first few numbers are:
x00000000
0
x00000001
1
x00000010
2
x00000100
3
x00001000
4
x00010000
5
…
// Implement the following stubs using our numbering system // described above. // Ignore negatives and bits falling off either end // Functions should be fast and use as little memory as possible // as they will be called often. // Functions should be generic and not employ some trick // that only works for 32-bit numbers. unsigned int add( unsigned int n1, unsigned int n2 ); // n1 >= n2 unsigned int subtract( unsigned int n1, unsigned int n2 );unsigned int multiply( unsigned int n1, unsigned int n2 ); //n2 != 0unsigned int divide( unsigned int n1, unsigned int n2 );