title: Compute Modulus Division By A Power Of 2 Number
signature: function computeModulusDivisionByAPowerOf2Number($n, $d) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($n, $d, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($n, $d), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        54, 59, 
        50));
      
      printf("TEST-1...%s\n",driver(
        39, 84, 
        3));
      
      printf("TEST-2...%s\n",driver(
        35, 81, 
        0));
      
      printf("TEST-3...%s\n",driver(
        9, 60, 
        9));
      
      printf("TEST-4...%s\n",driver(
        62, 68, 
        2));
      
      printf("TEST-5...%s\n",driver(
        16, 16, 
        0));
      
      printf("TEST-6...%s\n",driver(
        93, 96, 
        93));
      
      printf("TEST-7...%s\n",driver(
        32, 38, 
        32));
      
      printf("TEST-8...%s\n",driver(
        39, 62, 
        37));
      
      printf("TEST-9...%s\n",driver(
        63, 16, 
        15));
      
  }
  
  main();
  ?>
source_py: def compute_modulus_division_by_a_power_of_2_number(n, d):
      return (n & (d - 1))
source_cpp: unsigned int compute_modulus_division_by_a_power_of_2_number(unsigned int n, unsigned int d) {
    return ( n & ( d - 1 ) );
  }