I am getting some unexpected value from following code :
- (void) test
{
int target = 0;
int received = 0;
float result = (float)received/target;
NSLog(@"%.0f",result);
}
in console it prints " nan ". The target and received values may change. but when both are 0 than issue is created. I want to display result's value on label but it prints nan instead of float value.
what is wrong in code ?
Thanks...