If in the Xcode's debug console I type
(lldb) p (float)fabsf(-5.0f)
(float) $22 = 0
(lldb) p (double)fabsf(-5.0f)
(double) $23 = 5
where the first result casting to float (without casting, the p
command can't recognize the fabsf
return type) is wrong no matter the parameter.
But in the library headers the return type of fabs
is clearly a float. Can somebody explain me this?
ios9.2: math.h
...
extern float fabsf(float);
extern double fabs(double);
extern long double fabsl(long double);
...
Is there some lldb mechanism or issue which I am not aware of, or really a language implementation issue (guess not...)?
It was pretty sure a bug of lldb console in Xcode 7, and a ticket was created for it.
The issue is not present any more in Xcode 8.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With