title: How to compare NSNumber with a decimal value?
body: <p>I recently upgraded from iOS 5 to iOS 6 and found this unit test was failing</p>
  
  <pre><code>- (void)testCalculatesDistanceBetweenTwoPoints
  {
      self.sut = [[DistanceCalculator alloc] init];
      CLLocationCoordinate2D start = {.latitude = 34.32, .longitude = 99.13};
      CLLocationCoordinate2D finish = {.latitude = 105.94, .longitude = 27.73};
      NSNumber *distance = [self.sut kilometresBetweenPlace1:start andPlace2:finish];
      NSNumber *expected = [NSNumber numberWithDouble:3822.23073702318];
      STAssertEqualObjects(distance, expected, @"");
  }
  </code></pre>
  
  <p>The failing asserting </p>
  
  <blockquote>
    <p>'3822.23073702318' should be equal to '3822.23073702318'</p>
  </blockquote>
  
  <p>When I print the raw value of each number I get what looks like the same value</p>
  
  <pre><code>2012-10-23 20:01:42.970 HelloWorld[1573:c07] 1 3822.23073702318
  2012-10-23 20:01:42.970 HelloWorld[1573:c07] 2 3822.23073702318
  </code></pre>
  
  <p>When I print the type of each number I get what looks like the same (could I be doing this wrong?)</p>
  
  <pre><code>2012-10-23 20:06:37.309 HelloWorld[1611:c07] 1 __NSCFNumber 
  2012-10-23 20:06:37.309 HelloWorld[1611:c07] 2 __NSCFNumber
  </code></pre>
  
  <p>Here is the full blown implementation if that helps </p>
  
  <pre><code>- (NSNumber *)kilometresBetweenPlace1:(CLLocationCoordinate2D)place1 andPlace2:(CLLocationCoordinate2D)place2
  {
      MKMapPoint start = MKMapPointForCoordinate(place1);
      MKMapPoint finish = MKMapPointForCoordinate(place2);
  
      double distance = MKMetersBetweenMapPoints(start, finish) / 1600;
  
      return [NSNumber numberWithDouble:distance];
  }
  </code></pre>