Jer*_*rry 8 iphone nstimeinterval modulus
我有一个NSTimeInterval存储为double.我想使用%运算符获得第二个值的分钟数.
minutes = secondValue % 60;
Run Code Online (Sandbox Code Playgroud)
将分钟声明为 double minutes
结果是XCode说"二进制%的操作数无效"
思考?
Alc*_*ive 12
The OP changed their question, so here is my new answer:
你想要做minutes = floor(secondsValue) / 60; 你想要int除法,而不是模数.
| 归档时间: |
|
| 查看次数: |
33071 次 |
| 最近记录: |