I made this method
+ (CGFloat) round: (CGFloat)f {
int a = f;
CGFloat b = a;
return b;
}
It works as expected but it only round
There are already standard functions with behaviors you might need in such as: floorf, ceilf,
roundf, rintf and nearbyintf (lasf 'f' means "float" version, versions without it are "double" versions).
It is better to use standard methods not only because they are standard, but because they work better in edge cases.
2013 Update (jessedc)
iOS is no longer only 32 bit. There are a number of other answers to this question that are now more relevant.
Most answers mention importing tgmath.h