strange behavior:
(xcode 4 breakpoint screenshot)
why does this comparison yield true? I really dont get it..
The code seems to be working correctly,
are you sure the comparison validates true?
Quick snippet:
for(int i=0;i<10;i++){
float value = (arc4random()%100)/(float)100.0f;
NSLog(@"%f",value);
if(value < 0.01f) {
NSLog(@"YES");
} else {
NSLog(@"NO");
}
}
Output:
0.520000
NO
0.520000
NO
0.100000
NO
0.000000
YES
0.390000
NO
0.690000
NO
0.770000
NO
0.930000
NO
0.320000
NO
0.230000
NO
EDIT - Response to comment:
In my case, the breakpoints are working correctly:
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