title: Java doubles not comparing correctly in conditional
body: <p>Trying to use conditionals instead of if statements for double comparison. Debugged step by step several times and can not figure out on what planet java thinks -9==0. When you highlight it, it says false but increases the "zero" double anyways.. The other ones seem to come come across just fine. </p>
  
  <p>My input is: </p>
  
  <pre><code>6
  -4 3 -9 0 4 1  
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>public class HRWPlusMinus {
  public static void main(String[] args) {
      Scanner in = new Scanner(System.in);
      int length = Integer.valueOf(in.nextLine());
      String[] input = in.nextLine().split(" ");
          solveWOF(length, input);
      }
  
      //solve with for loop
      public static void solve(int length, String[] input) {
          double pos = 0;
          double neg = 0;
          double zero = 0;
          for (int i = 0; i &lt; length; i++){
              int test = Integer.valueOf(input[i]);
              if (test &gt; 0) {pos++;}
              else if (test &lt; 0) {neg++;}
              else {zero++;}
          }
          System.out.printf("%.6f \n%.6f \n%.6f", (pos/length), (neg/length), (zero/length));
      }
  
      //solve with conditionals
      public static void solveWOF(Integer length, String[] input) {
          double pos = 0, neg = 0, zero = 0;
          for (int i=0; i&lt;length; i++) {
              Double test = Double.valueOf(input[i]);
              zero = (test == 0)? zero++:
              test &gt; 0 ? pos++: neg++;
          }
          System.out.printf("%.6f \n%.6f \n%.6f", (pos/length), (neg/length), (zero/length));
      }
  }
  </code></pre>
  
  <p>Top method works, bottom one is the one I'm having issues with. </p>