Search in sources :

Example 1 with ValueDouble

use of org.h2.value.ValueDouble in project h2database by h2database.

the class TestValue method testModulusDouble.

private void testModulusDouble() {
    final ValueDouble vd1 = ValueDouble.get(12);
    new AssertThrows(ErrorCode.DIVISION_BY_ZERO_1) {

        @Override
        public void test() {
            vd1.modulus(ValueDouble.get(0));
        }
    };
    ValueDouble vd2 = ValueDouble.get(10);
    ValueDouble vd3 = vd1.modulus(vd2);
    assertEquals(2, vd3.getDouble());
}
Also used : ValueDouble(org.h2.value.ValueDouble) AssertThrows(org.h2.test.utils.AssertThrows)

Example 2 with ValueDouble

use of org.h2.value.ValueDouble in project h2database by h2database.

the class TestValueHashMap method testNotANumber.

private void testNotANumber() {
    ValueHashMap<Integer> map = ValueHashMap.newInstance();
    for (int i = 1; i < 100; i++) {
        double d = Double.longBitsToDouble(0x7ff0000000000000L | i);
        ValueDouble v = ValueDouble.get(d);
        map.put(v, null);
        assertEquals(1, map.size());
    }
}
Also used : ValueDouble(org.h2.value.ValueDouble)

Aggregations

ValueDouble (org.h2.value.ValueDouble)2 AssertThrows (org.h2.test.utils.AssertThrows)1