Use lrintf to fast convert floats to ints when possible