public static void main(String args[]) {
        BaseBarSeriesBuilder barSeriesBuilder = new BaseBarSeriesBuilder();
        BarSeries seriesD = barSeriesBuilder.withName("Sample Series Double    ")
                .withNumTypeOf(DoubleNum::valueOf)
                .build();
        BarSeries seriesP = barSeriesBuilder.withName("Sample Series DecimalNum 32")
                .withNumTypeOf(DecimalNum::valueOf)
                .build();
        BarSeries seriesPH = barSeriesBuilder.withName("Sample Series DecimalNum 256")
                .withNumTypeOf(number -> DecimalNum.valueOf(number.toString(), 256))
                .build();

        int[] randoms = new Random().ints(NUMBARS, 80, 100).toArray();
        for (int i = 0; i < randoms.length; i++) {
            ZonedDateTime date = ZonedDateTime.now().minusSeconds(NUMBARS - i);
            seriesD.addBar(date, randoms[i], randoms[i] + 21, randoms[i] - 21, randoms[i] - 5);
            seriesP.addBar(date, randoms[i], randoms[i] + 21, randoms[i] - 21, randoms[i] - 5);
            seriesPH.addBar(date, randoms[i], randoms[i] + 21, randoms[i] - 21, randoms[i] - 5);
        }
        Num D = DecimalNum.valueOf(test(seriesD).toString(), 256);
        Num P = DecimalNum.valueOf(test(seriesP).toString(), 256);
        Num standard = DecimalNum.valueOf(test(seriesPH).toString(), 256);
        System.out.println(seriesD.getName() + " error: "
                + D.minus(standard).dividedBy(standard).multipliedBy(DecimalNum.valueOf(100)));
        System.out.println(seriesP.getName() + " error: "
                + P.minus(standard).dividedBy(standard).multipliedBy(DecimalNum.valueOf(100)));
    }
@Test
    public void test() {
        CompareNumTypes.main(null);
    }