Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6.3 warning

I am getting this below warning after I update the Xcode to 6.3 version.

Using integer absolute value function 'abs' when argument is of floating point type

Example

 CGPoint startPoint = CGPointMake(15.0f, 25.0f);
 CGPoint endPoint   = CGPointMake(10.0f, 20.0f);
 CGFloat centerDiff = abs(startPoint.y - endPoint.y);
like image 692
Sheik_101 Avatar asked Apr 21 '15 12:04

Sheik_101


Video Answer


1 Answers

abs() expects integers. You should use fabs(value) for floating point values

like image 104
Philippe Leybaert Avatar answered Oct 18 '22 19:10

Philippe Leybaert