How can I concatenate a float to the next integer value in a C object?
1.1 -> 2 2.3 -> 3 3.4 -> 4 3.5 -> 4 3.6 -> 4 1.0000000001 -> 2
You need a ceiling function. Used like this:
float roundedup = ceil(otherfloat);
Use the ceil() function.
ceil()
Someone did a little math in an Objective-C entry here: http://webbuilders.wordpress.com/2009/04/01/objective-c-math/
I just could not comment on Davids' answer. His second answer will not work, since modulo does not work with floating point values. Doesn't it look like
if (originalFloat - (int)originalFloat > 0) { originalFloat += 1; round = (int)originalFloat; }