title: Calculate log base 2 recursion
body: <p>i'm creating recursion method that calculate Log base 2. for log*(1) = should be 0. log*(4) = should be 2. but my method only print out zero and i couldn't figure out the problem.can some one help me?</p>
  
  <pre><code>public static int logCalculator(double n) {
      if (n == 1) {
          return 0;
      } else {
          return 1 + logCalculator(n * n);
      }
  }
  </code></pre>