Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong max value for log2m? #1

Closed
iconara opened this issue Dec 27, 2013 · 1 comment
Closed

Wrong max value for log2m? #1

iconara opened this issue Dec 27, 2013 · 1 comment

Comments

@iconara
Copy link

iconara commented Dec 27, 2013

The docs say that the log2m parameter must "be at least 4 and at most 31", but it seems that 30 is the highest possible value.

The following line raises a NegativeArraySizeException:

new HLL(31, 8, -1, true, HLLType.FULL);

Here's the full stack trace:

Exception in thread "main" java.lang.NegativeArraySizeException
    at net.agkn.hll.util.BitVector.<init>(BitVector.java:68)
    at net.agkn.hll.HLL.initializeStorage(HLL.java:434)
    at net.agkn.hll.HLL.<init>(HLL.java:202)
    at Spike.main(Spike.java:7)

If I change 31 to 30 it works fine.

@ghost ghost closed this as completed in 3fff716 Jan 10, 2014
@ghost
Copy link

ghost commented Jan 10, 2014

Thanks for noticing! This has been fixed and I've added some bounds checking to the constructors to enforce this.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant