objective c - how can i convert NSNumber to CLLocationDistance? -
i have convert nsnumber cllocationdistance comparing them. there formatter that? searched @ internet not find.
cllocationdistance double. need this:
nsnumber *number = ... // number cllocationdistance distance = ... // distance if (distance == [number doublevalue]) { // equal } keep in mind comparing 2 double values equality can appear fail due inexactness of double values.
if (abs(distance - [number doublevalue]) <= dbl_epsilon) { // equal }
Comments
Post a Comment