Cri*_*ian 1 cocoa-touch objective-c nsuinteger ios
我有一个 NSUInteger,我想将它除以 100。假设我在 NSUInteger 中有数字 1,我想将它除以 100 并得到 0.01 作为结果。
(float) percent / 100
Run Code Online (Sandbox Code Playgroud)
百分比是一个 NSUInteger
两个整数相除时,结果将是一个整数。将其中之一设置为浮点数(常量是典型的)
float percent = grade / 100.0f;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
849 次 |
| 最近记录: |