<分区>
<分区>
我有一个 NSUInteger,我想将它除以 100。假设我在 NSUInteger 中有数字 1,我想将它除以 100,得到 0.01 作为结果。
(float) percent / 100
percent 是一个 NSUInteger
最佳答案
当两个整数相除时,结果将是一个整数。将其中一个设为 float (常量是典型值)
float percent = grade / 100.0f;
关于objective-c - 将 NSUInteger 除以 100,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11977841/