@Test public void testNaN() { final TDigest digest = factory().create(); Random gen = getRandom(); final int iters = gen.nextInt(100); for (int i = 0; i < iters; ++i) { digest.add(gen.nextDouble(), 1 + gen.nextInt(10)); } try { if (gen.nextBoolean()) { digest.add(Double.NaN); } else { digest.add(Double.NaN, 1); } fail("NaN should be an illegal argument"); } catch (IllegalArgumentException e) { } }
public abstract void add(double x, int w);
TDigest implements Serializable { public abstract void add(double x, int w); }
TDigest implements Serializable { public abstract void add(double x, int w);  }
TDigest implements Serializable { public abstract void add(double x, int w);  @SuppressWarnings("WeakerAccess") static TDigest createMergingDigest(double compression); @SuppressWarnings("WeakerAccess") static TDigest createAvlTreeDigest(double compression); @SuppressWarnings({"unused", "WeakerAccess", "SameParameterValue"}) static TDigest createDigest(double compression); abstract void add(double x, int w); abstract void add(List<? extends TDigest> others); abstract void compress(); abstract long size(); abstract double cdf(double x); abstract double quantile(double q); abstract Collection<Centroid> centroids(); abstract double compression(); abstract int byteSize(); abstract int smallByteSize(); void setScaleFunction(ScaleFunction scaleFunction); abstract void asBytes(ByteBuffer buf); abstract void asSmallBytes(ByteBuffer buf); abstract TDigest recordAllData(); abstract boolean isRecording(); abstract void add(double x); abstract void add(TDigest other); abstract int centroidCount(); double getMin(); double getMax(); }
TDigest implements Serializable { public abstract void add(double x, int w);  @SuppressWarnings("WeakerAccess") static TDigest createMergingDigest(double compression); @SuppressWarnings("WeakerAccess") static TDigest createAvlTreeDigest(double compression); @SuppressWarnings({"unused", "WeakerAccess", "SameParameterValue"}) static TDigest createDigest(double compression); abstract void add(double x, int w); abstract void add(List<? extends TDigest> others); abstract void compress(); abstract long size(); abstract double cdf(double x); abstract double quantile(double q); abstract Collection<Centroid> centroids(); abstract double compression(); abstract int byteSize(); abstract int smallByteSize(); void setScaleFunction(ScaleFunction scaleFunction); abstract void asBytes(ByteBuffer buf); abstract void asSmallBytes(ByteBuffer buf); abstract TDigest recordAllData(); abstract boolean isRecording(); abstract void add(double x); abstract void add(TDigest other); abstract int centroidCount(); double getMin(); double getMax();  }