@Test public void testDiv() { DoubleMemory memory = new DoubleMemory(10); Assert.assertEquals(5, memory.div(2).toDouble(), 0.00001); Assert.assertEquals(Memory.Type.DOUBLE, memory.div(2).type); Assert.assertEquals(10, memory.div(true).toDouble(), 0.000001); Assert.assertEquals(Memory.Type.DOUBLE, memory.div(true).type); Assert.assertEquals(5, memory.div(2.0).toDouble(), 0.0001); Assert.assertEquals(Memory.Type.DOUBLE, memory.div(2.0).type); }
@Test public void testDivInvalidNull() { DoubleMemory memory = new DoubleMemory(10); Assert.assertEquals(Memory.FALSE, memory.div(Memory.NULL)); }
@Test public void testDivInvalidFalse() { DoubleMemory memory = new DoubleMemory(10); Assert.assertEquals(Memory.FALSE, memory.div(false)); }