Friday, September 26, 2014

Completed Lab - Bitwise Arithmetic

Lab 4 - Bitwise Operators

Implement the following functions without using the +, -, *, /, ++ or -- operators
  • Addition
  • Subtraction
  • Multiplication 
  • Reverse the bit order of an int
  • Determine if an int is negative or not
  • Determine if an int contains an even number of bits 
  • Determine if two ints have the same sign
  • Store a date in a specific format and get the year/month/day of that date 
You can only use the "bitwise" operators (&, |, ^, <<, >>, ~) along with !, =, ==, !=, && and ||

No comments:

Post a Comment