float Numbertoround;
int result;
Numbertoround = 4.51;
result = (int)roundf (numbertoround);
NSLog (@ "ROUNDF (%f) =%d", numbertoround, result); //ROUNDF (4.510000) = 5
result = (int)CEILF (numbertoround);
NSLog (@ "CEILF (%f) =%d", numbertoround, result); CEILF (4.510000) = 5
result = (int)Floorf (numbertoround);
NSLog (@ "Floorf (%f) =%d", numbertoround, result); Floorf (4.510000) = 4
Numbertoround = 10.49;
result = (int)roundf (numbertoround);
NSLog (@ "ROUNDF (%f) =%d", numbertoround, result); ROUNDF (10.490000) = ten
result = (int)CEILF (numbertoround);
NSLog (@ "CEILF (%f) =%d", numbertoround, result); CEILF (10.490000) = One
result = (int)Floorf (numbertoround);
NSLog (@ "Floorf (%f) =%d", numbertoround, result); Floorf (10.490000) = ten
Numbertoround =-2.49;
result = (int)roundf (numbertoround);
NSLog (@ "ROUNDF (%f) =%d", numbertoround, result); ROUNDF ( -2.490000) = 2
result = (int)CEILF (numbertoround);
NSLog (@ "CEILF (%f) =%d", numbertoround, result); CEILF ( -2.490000) = 2
result = (int)Floorf (numbertoround);
NSLog (@ "Floorf (%f) =%d", numbertoround, result); Floorf ( -2.490000) = 3
Numbertoround =-3.51;
result = (int)roundf (numbertoround);
NSLog (@ "ROUNDF (%f) =%d", numbertoround, result); ROUNDF ( -3.510000) = 4
result = (int)CEILF (numbertoround);
NSLog (@ "CEILF (%f) =%d", numbertoround, result); CEILF ( -3.510000) = 3
result = (int)Floorf (numbertoround);
NSLog (@ "Floorf (%f) =%d", numbertoround, result); Floorf ( -3.510000) = 4
IOS rounding into a method of de-tail method