我将 Xcode 更新到 6.3 版本后收到以下警告。
Using integer absolute value function 'abs' when argument is of floating point type
例子
CGPoint startPoint = CGPointMake(15.0f, 25.0f);
CGPoint endPoint = CGPointMake(10.0f, 20.0f);
CGFloat centerDiff = abs(startPoint.y - endPoint.y);
最佳答案
abs()
需要整数。您应该使用 fabs(value)
作为浮点值
关于ios - Xcode 6.3 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29772769/