Skip to content

BinomialBoundsN may divide 0 #707

@ZENOTME

Description

@ZENOTME

From exception, BinomialBoundsN is expect to not take the 0 theta.(To prevent "divide 0" happend).

throw new SketchesArgumentException("0.0 < theta <= 1.0: " + theta);
But actually it doesn't check whether theta is 0.

Following test is fail to check this because this test will pass if any checkArgs throw exception.

  @Test
  public static void checkCheckArgs() {
    try {
      checkArgs(-1L, 1.0, 1);
      checkArgs(10L, 0.0, 1);
      checkArgs(10L, 1.01, 1);
      checkArgs(10L, 1.0, 3);
      checkArgs(10L, 1.0, 0);
      checkArgs(10L, 1.0, 4);
      fail("Expected SketchesArgumentException");
    } catch (final SketchesArgumentException e) {
      //pass
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions