title: Check If A Number Is Power Of Another Number 1
signature: function checkIfANumberIsPowerOfAnotherNumber1($x, $y) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($x, $y, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($x, $y), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        57, 1, 
        1));
      
      printf("TEST-1...%s\n",driver(
        3, 9, 
        1));
      
      printf("TEST-2...%s\n",driver(
        10, 101, 
        1));
      
      printf("TEST-3...%s\n",driver(
        10, 10000, 
        1));
      
      printf("TEST-4...%s\n",driver(
        6, 46656, 
        1));
      
      printf("TEST-5...%s\n",driver(
        2, 2048, 
        1));
      
      printf("TEST-6...%s\n",driver(
        2, 40, 
        1));
      
      printf("TEST-7...%s\n",driver(
        20, 79, 
        1));
      
      printf("TEST-8...%s\n",driver(
        96, 98, 
        1));
      
      printf("TEST-9...%s\n",driver(
        25, 5, 
        1));
      
  }
  
  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 );
  }