This should be roundf - the floating point version of the method is more efficient.