經安全檢測,此網站為安全網站,請放心前往原始網址!

Divide int's and round up in Objective-C - Stack Overflow

If your ints are A and B and you want to have ceil(A/B) just calculate (A+B-1)/B . ... What about: float A,B; // this variables have to be floats! int result = floor(A/B); ...

stackoverflow.com

網址安全性掃描由 google 提供