Should I use roundf that is for float input and returns a float value? the function round seems to work equally well. Any views on this?
roundf and other functions in the "round" family should be used wherever a float or double must be rounded, that includes both input (before any calculation is performed using it) or output (values that are the result of some calculation).
Beside that I'm not exactly sure what you're asking, you may want to check the man page for the "round" family here or with
man round in the terminal.
Edit, I'm not sure if I was clear enough;
round both do the exact same thing, round a variable, the difference however, is that
roundf returns a float, whereas
round returns a double. A double is just a "float" of 8 bytes instead of 4, therefore a double is even more precise than a float. Ultimately it doesn't matter which you decide to use, since 4 more bytes is hardly anything.