@Test public void testEvaluateBinaryLong() { OpBehaviorIntCarry op = new OpBehaviorIntCarry(); Assert.assertEquals(0, op.evaluateBinary(4, 4, 0, 0)); Assert.assertEquals(1, op.evaluateBinary(4, 4, 1, 0xffffffffL)); Assert.assertEquals(1, op.evaluateBinary(4, 4, 0xffffffffL, 1)); Assert.assertEquals(0, op.evaluateBinary(4, 4, 0x7fffffffL, 0x80000000L)); Assert.assertEquals(1, op.evaluateBinary(4, 4, 0x7fffffffL, 0x80000001L)); Assert.assertEquals(0, op.evaluateBinary(4, 4, 0x80000000L, 0x7fffffffL)); Assert.assertEquals(1, op.evaluateBinary(4, 4, 0x80000001L, 0x7fffffffL)); Assert.assertEquals(0, op.evaluateBinary(8, 8, 0, 0)); Assert.assertEquals(0, op.evaluateBinary(8, 8, Long.MAX_VALUE, Long.MIN_VALUE)); Assert.assertEquals(1, op.evaluateBinary(8, 8, Long.MAX_VALUE, Long.MIN_VALUE + 1)); Assert.assertEquals(0, op.evaluateBinary(8, 8, Long.MIN_VALUE, Long.MAX_VALUE)); Assert.assertEquals(1, op.evaluateBinary(8, 8, Long.MIN_VALUE + 1, Long.MAX_VALUE)); }
@Override public long evaluateBinary(int sizeout, int sizein, long in1, long in2) { if (sizein == 8) { if (in1 < 0) { return ((in2 < 0) || (-in2 <= in1)) ? 1 : 0; } if (in2 < 0) { return (-in1 <= in2) ? 1 : 0; } } return (in1 > ((in1 + in2) & Utils.calc_mask(sizein))) ? 1 : 0; }
OpBehaviorIntCarry extends BinaryOpBehavior { @Override public long evaluateBinary(int sizeout, int sizein, long in1, long in2) { if (sizein == 8) { if (in1 < 0) { return ((in2 < 0) || (-in2 <= in1)) ? 1 : 0; } if (in2 < 0) { return (-in1 <= in2) ? 1 : 0; } } return (in1 > ((in1 + in2) & Utils.calc_mask(sizein))) ? 1 : 0; } }
OpBehaviorIntCarry extends BinaryOpBehavior { @Override public long evaluateBinary(int sizeout, int sizein, long in1, long in2) { if (sizein == 8) { if (in1 < 0) { return ((in2 < 0) || (-in2 <= in1)) ? 1 : 0; } if (in2 < 0) { return (-in1 <= in2) ? 1 : 0; } } return (in1 > ((in1 + in2) & Utils.calc_mask(sizein))) ? 1 : 0; } OpBehaviorIntCarry(); }
OpBehaviorIntCarry extends BinaryOpBehavior { @Override public long evaluateBinary(int sizeout, int sizein, long in1, long in2) { if (sizein == 8) { if (in1 < 0) { return ((in2 < 0) || (-in2 <= in1)) ? 1 : 0; } if (in2 < 0) { return (-in1 <= in2) ? 1 : 0; } } return (in1 > ((in1 + in2) & Utils.calc_mask(sizein))) ? 1 : 0; } OpBehaviorIntCarry(); @Override long evaluateBinary(int sizeout, int sizein, long in1, long in2); @Override BigInteger evaluateBinary(int sizeout, int sizein, BigInteger in1, BigInteger in2); }
OpBehaviorIntCarry extends BinaryOpBehavior { @Override public long evaluateBinary(int sizeout, int sizein, long in1, long in2) { if (sizein == 8) { if (in1 < 0) { return ((in2 < 0) || (-in2 <= in1)) ? 1 : 0; } if (in2 < 0) { return (-in1 <= in2) ? 1 : 0; } } return (in1 > ((in1 + in2) & Utils.calc_mask(sizein))) ? 1 : 0; } OpBehaviorIntCarry(); @Override long evaluateBinary(int sizeout, int sizein, long in1, long in2); @Override BigInteger evaluateBinary(int sizeout, int sizein, BigInteger in1, BigInteger in2);  }