Oddly enough, I can't find how to cleanly convert a float to int .
This method
int int_value = (int)(float_value + 0.5);
starts up
warning: use of old-style cast
in gcc.
So what is modern style, an easy way to convert float to int ? (I agree with the loss of accuracy, of course)
source share