0
혼합 데이터 형식의 변수를 사용하여 완료율을 계산합니다.혼합 변수 데이터 형식을 사용하는 수학
2011-01-11 10:02:59.993 [18570:207] Incomplete Total: 12
2011-01-11 10:02:59.993 [18570:207] Total Total: 24
2011-01-11 10:02:59.994 [18570:207] Progress: 0
왜 진행이 "50"를 반환하지 않습니다 다음과 같이
int incompleteCritical = 12;
int total = 24;
float progress = 0;
NSLog(@"Incomplete Total: %d", incompleteCritical);
NSLog(@"Total Total: %d", total);
if (total > 0) {
progress = ((float)incompleteCritical/(float)total)*100;
NSLog(@"Progress: %d", progress);
}
콘솔 출력은?