我很想知道如何将数字舍入到最接近的第十个整数.例如,如果我有:
int a = 59 / 4;
以浮点计算的14.75; 如何将数字存储为"a"中的15?
c math int rounding integer-division
对于每个课程,我存储星期几用户所拥有的课程......以及开始和结束时间以及房间号码.在数据类型方面最好的方法是什么,比如存储时间?因此,当我把它拉出来时,我可以显示它,例如下午1点.
谢谢!
iphone macos xcode core-data
c ×1
core-data ×1
int ×1
integer-division ×1
iphone ×1
macos ×1
math ×1
rounding ×1
xcode ×1