Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "fabs" in Objective C? [closed]

Tags:

c

objective-c

Found this bit of code...

if(fabs([tempPlacemark getCoordinate].latitude-latitude) < latDelta && fabs([tempPlacemark getCoordinate].longitude-longitude)<longDelta )
...

refers to this in Math.h:

extern float fabsf(float);
extern double fabs(double);
extern long double fabsl(long double);

So what am I looking at?

like image 450
darkheartfelt Avatar asked Dec 20 '13 01:12

darkheartfelt


1 Answers

double fabs( double ) - returns the absolute value of the argument

NSLog(@"res: %.f", fabs(10)); //result 10 NSLog(@"res: %.f", fabs(-10)); //result 10

found here.

like image 90
darkheartfelt Avatar answered Nov 17 '22 06:11

darkheartfelt