title: divide by zero error
body: <p>here is the code (java): </p>
  
  <pre><code>class prime
  {
  
      public static boolean prime (int a, int b) 
      { 
          if (a == 0) 
          {
              return false; 
          }
          else if ((a%(b-1) == 0) &amp;&amp; (b&gt;2))
          {
              return false; 
          }
          else if (b&gt;1) 
          {
              return (prime (a, b-1)) ;
          }
          else
          {
              return true; 
          }
  
      }
  
      public static void main (String[] arg) 
      {
          System.out.println (prime (7, 7)) ; 
      }
  }
  </code></pre>
  
  <p>This is the error message i get when i try to run it (it compiles fine): </p>
  
  <pre><code>Exception in thread "main" java.lang.ArithmeticException: / by zero
      at prime.prime(prime.java:10)
      at prime.prime(prime.java:16)
      at prime.prime(prime.java:16)
      at prime.prime(prime.java:16)
      at prime.prime(prime.java:16)
      at prime.prime(prime.java:16)
      at prime.prime(prime.java:16)
      at prime.main(prime.java:27)
  </code></pre>
  
  <p>So this means i devided by zero some how right? or does it mean something else? I don't see how i'm dividing by zero. What went wrong? </p>