The +0.5f is a cheap way of doing a round operation when casting to int. It could indeed be replaced by roundf().