Try this:
const CGFloat a = 8926.5;
const CGFloat b = 8926.5;
if (a<b)
{
NSLog(@"Yes");
}
else
{
NSLog(@"No");
}
This will print No
.
Now change the value like
const CGFloat a = 8926.5;
const CGFloat b = 8926.50007;
This will print Yes
. But if you print these values using LLDB
or po
statement both will display 8926.5 . So issue is with the values, and LLDB
wraps the value. That's why the issue happens.
Suggestion:
Change the if condition like:
if(fabsf(MYFIRSTFLOAT)<fabsf(THESECONDFLOAT))
{
//Do something
}