title: iphone / Objective C - Comparing doubles not working
body: <p>I think I'm going insane. 
  "counter" and "interval" are both doubles. This is happening on accelerometer:didAccelerate at an interval of (.01) . "counter" should eventually increment to "interval". For some reason i cant get this "if" to ring true.  </p>
  
  <p>Am I overlooking something?</p>
  
  <pre><code>double interval = .5;
   if( counter == interval ){ //should eventually be .50000 == .50000
    NSLog( @"Hit!" );
    [self playSound];
    counter = 0;
   }else{
    counter += .01;
   }
  NSLog( @"%f, %f, %d",counter,interval,(counter == interval) );
  </code></pre>