title: Java Math.sqrt function rounding down to zero
body: <p>I am trying to write a function to check a T score value and populate half of a 5x5 array.</p>
  <pre><code>public void calcTScores()
      {
          double temp = 0;
          double tempSp = 0;
          int n = 24;
          this.tScores = new String [5][5];
          for (int i = 0; i&lt; this.Headers.length; i++){
               for (int j = 0; j&lt;this.Headers.length; j++)
               {
                   if(i &lt; j)
                   {
                       tempSp += (n-1)*this.SD[i] * this.SD[i] + (n-1)*this.SD[j] * this.SD[j];
                       tempSp = tempSp/(n+n-2);
                       tempSp = Math.sqrt(tempSp);
                       temp = tempSp * Math.sqrt(0.0833);
                       System.out.println(Math.sqrt(1/12));
                       temp = ((this.Mean[i] - this.Mean[j])/temp);
                       if(temp &gt; 2.25 || temp&lt; -2.25)
                       {
                           this.tScores[i][j] = &quot;Y&quot;;
                       }
                       else 
                       {
                           this.tScores[i][j] = &quot;N&quot;;   
                       }
                       temp = 0;
                       tempSp = 0;
                   }
               }
          }
      }
  </code></pre>
  <p>Any idea why Math.sqrt(0.0833) and Math.sqrt(1/12) would evaluate to different values?</p>
  <p>The T score when I add the 1/24 and 1/24 value and take the sqrt keeps evaluating to zero but when I plug in the actual decimal it gives me the answer I would expect</p>
  <p>Any ideas why this is occuring?</p>