#pragma mark === 四舍五入
-(int)roundedRoundfWith:(float)numberToRound
{
int result;
result = (int)roundf(numberToRound);
NSLog(@"roundf(%.2f) = %d", numberToRound, result);
//
return result;
}
#pragma mark === 进位
-(int)roundedCeilfWith:(float)numberToRound
{
int result;
result = (int)ceilf(numberToRound);
NSLog(@"roundf(%.2f) = %d", numberToRound, result);
return result;
}
#pragma mark === 摸位 取整
-(int)floatChangeToIntWith:(float)numberToRound
{
int result;
result = (int)floorf(numberToRound);
NSLog(@"roundf(%.2f) = %d", numberToRound, result);
return result;
}
网友评论