static boolean isPowerOf ( long val , int base ) {
  while ( val > 1 ) {
    if ( val % base != 0 ) return false ;
    val /= base ;
  }
  return true ;
}

static boolean isPowerOf ( long val , int base ) { while ( val > 1 ) { if ( val % base != 0 ) return false ; val /= base ; } return true ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) consequence: (return_statement (false))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (return_statement (true))))