externfloatceilf(float);
externdoubleceil(double);
externlongdoubleceill(longdouble);
externfloatfloorf(float);
externdoublefloor(double);
externlongdoublefloorl(longdouble);
externfloatroundf(float);
externdoubleround(double);
externlongdoubleroundl(longdouble);
round:如果參數(shù)是小數(shù)猾封,則求本身的四舍五入剑鞍。
ceil:如果參數(shù)是小數(shù),則求最小的整數(shù)但不小于本身.
floor:如果參數(shù)是小數(shù)瓦阐,則求最大的整數(shù)但不大于本身.
Example:如何值是3.4的話披泪,則
3.4 -- round 3.000000
-- ceil 4.000000
-- floor 3.00000
CGRectMake(floorf(self.view.bounds.size.width*0.5f-39.f*0.5f),self.view.bounds.size.height-57,39,39)
其中floorf(self.view.bounds.size.width*0.5f-39.f*0.5f)返回值為
140.000000這種形式