Package net.jcores.jre.cores

Examples of net.jcores.jre.cores.CoreNumber.sum()


            Assert.assertEquals(Data.sn.length, as.size());
            Assert.assertEquals(Data.sn.length, as.compact().size());

            final long i = Data.sn.length - 1;
            Assert.assertEquals(i * (i + 1) / 2, (long) as.sum());
        }
    }

    /** */
    @SuppressWarnings("boxing")
View Full Code Here


    @Test
    public void testNullNaN() {
        final CoreObject<Object> mixed = $($.create(1, 100), $.create(null, 100), $.create(Double.NaN, 100)).expand(Object.class);
        final CoreNumber number = mixed.random(1.0).as(CoreNumber.class);
       
        Assert.assertEquals(100, number.sum(), 0.01);
        Assert.assertEquals(1, number.average(), 0.01);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.