If a value is just outside the interval, such that it can be caused by round-off errors in the averaging, put it within so that the bounds-checks doesn't fail.