Skip to content

Commit

Permalink
Use Math.ceil instead of rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
dungba88 committed Nov 18, 2024
1 parent ccd3e25 commit f9da336
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class TwoPhaseKnnVectorQuery extends KnnFloatVectorQuery {
*/
public TwoPhaseKnnVectorQuery(
String field, float[] target, int k, double oversample, Query filter) {
super(field, target, k + (int) Math.round(k * oversample), filter);
super(field, target, k + (int) Math.ceil(k * oversample), filter);
if (oversample < 0) {
throw new IllegalArgumentException("oversample must be non-negative, got " + oversample);
}
Expand Down

0 comments on commit f9da336

Please sign in to comment.