title: Check If A Number Is Power Of Another Number 1
signature: function check_if_a_number_is_power_of_another_number_1(x, y)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(x, y, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(x, y), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(57, 1, 1);
      @printf("TEST-0...%s\n",result);
      
      result = driver(3, 9, 1);
      @printf("TEST-1...%s\n",result);
      
      result = driver(10, 101, 1);
      @printf("TEST-2...%s\n",result);
      
      result = driver(10, 10000, 1);
      @printf("TEST-3...%s\n",result);
      
      result = driver(6, 46656, 1);
      @printf("TEST-4...%s\n",result);
      
      result = driver(2, 2048, 1);
      @printf("TEST-5...%s\n",result);
      
      result = driver(2, 40, 1);
      @printf("TEST-6...%s\n",result);
      
      result = driver(20, 79, 1);
      @printf("TEST-7...%s\n",result);
      
      result = driver(96, 98, 1);
      @printf("TEST-8...%s\n",result);
      
      result = driver(25, 5, 1);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
source_py: def check_if_a_number_is_power_of_another_number_1(x, y):
      res1 = (math.log(y) / math.log(x))
      res2 = (math.log(y) / math.log(x))
      return (1 if (res1 == res2) else 0)
source_cpp: bool check_if_a_number_is_power_of_another_number_1(int x, int y) {
    int res1 = log ( y ) / log ( x );
    double res2 = log ( y ) / log ( x );
    return ( res1 == res2 );
  }