static int no_of_characters ( int M ) {
  int k = 1 ;
  while ( true ) {
    if ( ( int ) Math . pow ( 2 , k + 1 ) - 2 < M ) k ++ ;
    else break ;
  }
  return k ;
}

static int no_of_characters ( int M ) { int k = 1 ; while ( true ) { if ( ( int ) Math . pow ( 2 , k + 1 ) - 2 < M ) k ++ ; else break ; } return k ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (true)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (decimal_integer_literal))))) right: (decimal_integer_literal)) right: (identifier))) consequence: (expression_statement (update_expression (identifier))) alternative: (break_statement)))) (return_statement (identifier))))