tweaked knn bound to avoid rounding error