mirror of https://github.com/apache/lucene.git
Use Math.ceil instead of rounding
This commit is contained in:
parent
ccd3e25c62
commit
f9da336ed9
|
@ -51,7 +51,7 @@ public class TwoPhaseKnnVectorQuery extends KnnFloatVectorQuery {
|
||||||
*/
|
*/
|
||||||
public TwoPhaseKnnVectorQuery(
|
public TwoPhaseKnnVectorQuery(
|
||||||
String field, float[] target, int k, double oversample, Query filter) {
|
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) {
|
if (oversample < 0) {
|
||||||
throw new IllegalArgumentException("oversample must be non-negative, got " + oversample);
|
throw new IllegalArgumentException("oversample must be non-negative, got " + oversample);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue