How might I round a float to the nearest integer in Objective-C:
Example:
float f = 45.698f; int rounded = _______; NSLog(@\"the rounded float is %i\
Use the C standard function family round(). roundf() for float, round() for double, and roundl() for long double. You can then cast the result to the integer type of your choice.
round()
roundf()
float
double
roundl()
long double