Skip to content

Commit fef7500

Browse files
author
lrhodes
committed
Fixed checkK() in both quantiles and KLL.
1 parent 3773d6d commit fef7500

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/main/java/com/yahoo/sketches/kll/KllFloatsSketch.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package com.yahoo.sketches.kll;
77

8-
import static com.yahoo.sketches.Util.isPowerOf2;
98
import static java.lang.Math.abs;
109
import static java.lang.Math.ceil;
1110
import static java.lang.Math.exp;
@@ -785,12 +784,12 @@ public static KllFloatsSketch heapify(final Memory mem) {
785784

786785
/**
787786
* Checks the validity of the given value k
788-
* @param k must be greater than 1 and less than 65536.
787+
* @param k must be greater than 7 and less than 65536.
789788
*/
790789
static void checkK(final int k) {
791-
if ((k < MIN_K) || (k > MAX_K) || !isPowerOf2(k)) {
790+
if ((k < MIN_K) || (k > MAX_K)) {
792791
throw new SketchesArgumentException(
793-
"K must be >= " + MIN_K + " and <= " + MAX_K + " and a power of 2: " + k);
792+
"K must be >= " + MIN_K + " and <= " + MAX_K + ": " + k);
794793
}
795794
}
796795

src/main/java/com/yahoo/sketches/quantiles/Util.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public static int getKFromEpsilon(final double epsilon, final boolean pmf) {
208208

209209
/**
210210
* Checks the validity of the given value k
211-
* @param k must be greater than 1 and less than 65536.
211+
* @param k must be greater than 1 and less than 65536 and a power of 2.
212212
*/
213213
static void checkK(final int k) {
214214
if ((k < MIN_K) || (k > MAX_K) || !isPowerOf2(k)) {

0 commit comments

Comments
 (0)