accuracy-problems

Floating Point Arithmetic - Modulo Operator on Double Type

So I'm trying to figure out why the modulo operator is returning such a large unusual value. If I have the code: double result = 1.0d % 0.1d; it will give a result of 0.09999999999999995. I would expect a value of 0 Note this problem doesn't exist using the dividing operator - double result = 1.0d / 0.1d; will give a result of 1...

iPhone CoreLocation - accuracy not working correctly!?

I am developing an app which uses gps. i need a high accuracy so i used kCLLocationAccuracyBestForNavigation for the desiredAccuracy. when i am running the app, the follwing method gets called as expected. (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLoca...