1

I'm trying to get the absolute value of a CGFloat parameter but I'm getting the following warning:

Absolute value function 'fabsf' given an argument of type 'CGFloat' (aka 'double') but has parameter of type 'float' which may cause truncation of value

Cœur
  • 37,241
  • 25
  • 195
  • 267
YogevSitton
  • 10,068
  • 11
  • 62
  • 95

1 Answers1

2

A CGFloat is a double on 64 bit platforms, but you're passing it to fabsf, which expects a single precision float - use fabs instead, which takes a double as an argument.

Paul R
  • 208,748
  • 37
  • 389
  • 560