If in the Xcode debug console, type
(lldb) p (float)fabsf(-5.0f) (float) $22 = 0 (lldb) p (double)fabsf(-5.0f) (double) $23 = 5
where the first casting result for float (without casting, the p command cannot recognize the return type fabsf ) is incorrect regardless of the parameter .
But in the library headers, the return type fabs clearly a float. Can someone explain this to me?
ios9.2: math.h
... extern float fabsf(float); extern double fabs(double); extern long double fabsl(long double); ...
Is there any lldb mechanism or problem that I don't know about, or is it really a language implementation problem (guess not ...)?
source share