when discrete mode, add 0.5 when cast to int