### Question:
OpBehaviorFloatEqual extends BinaryOpBehavior { @Override public long evaluateBinary(int sizeout, int sizein, long in1, long in2) { FloatFormat format = FloatFormatFactory.getFloatFormat(sizein); return format.opEqual(in1, in2); } OpBehaviorFloatEqual(); @Override long evaluateBinary(int sizeout, int sizein, long in1, long in2); @Override BigInteger evaluateBinary(int sizeout, int sizein, BigInteger in1, BigInteger in2);  }### Answer:
@Test public void testEvaluateBinaryLong() { OpBehaviorFloatEqual op = new OpBehaviorFloatEqual(); FloatFormat ff = FloatFormatFactory.getFloatFormat(8); Assert.assertEquals(1, op.evaluateBinary(8, 8, ff.getEncoding(1.234), ff.getEncoding(1.234))); Assert.assertEquals(1, op.evaluateBinary(8, 8, ff.getEncoding(-1.234), ff.getEncoding(-1.234))); Assert.assertEquals(0, op.evaluateBinary(8, 8, ff.getEncoding(-1.234), ff.getEncoding(1.234))); Assert.assertEquals( 1, op.evaluateBinary(8, 8, ff.getEncoding(Double.POSITIVE_INFINITY), ff.getEncoding(Double.POSITIVE_INFINITY))); Assert.assertEquals( 0, op.evaluateBinary(8, 8, ff.getEncoding(Double.POSITIVE_INFINITY), ff.getEncoding(Double.NEGATIVE_INFINITY))); Assert.assertEquals( 1, op.evaluateBinary(8, 8, ff.getEncoding(Double.NEGATIVE_INFINITY), ff.getEncoding(Double.NEGATIVE_INFINITY))); Assert.assertEquals( 0, op.evaluateBinary(8, 8, ff.getEncoding(Double.POSITIVE_INFINITY), ff.getEncoding(Double.NaN))); }
@Test public void testEvaluateBinaryBigInteger() { OpBehaviorFloatEqual op = new OpBehaviorFloatEqual(); FloatFormat ff = FloatFormatFactory.getFloatFormat(8); BigDecimal a = BigDecimal.valueOf(1.234d); BigDecimal b = BigDecimal.valueOf(-1.234d); Assert.assertEquals(BigInteger.ONE, op.evaluateBinary(8, 8, ff.getEncoding(a), ff.getEncoding(a))); Assert.assertEquals(BigInteger.ONE, op.evaluateBinary(8, 8, ff.getEncoding(b), ff.getEncoding(b))); Assert.assertEquals(BigInteger.ZERO, op.evaluateBinary(8, 8, ff.getEncoding(b), ff.getEncoding(a))); Assert.assertEquals( BigInteger.ONE, op.evaluateBinary(8, 8, ff.getEncoding(FloatFormat.BIG_POSITIVE_INFINITY), ff.getEncoding(FloatFormat.BIG_POSITIVE_INFINITY))); Assert.assertEquals( BigInteger.ZERO, op.evaluateBinary(8, 8, ff.getEncoding(FloatFormat.BIG_POSITIVE_INFINITY), ff.getEncoding(FloatFormat.BIG_NEGATIVE_INFINITY))); Assert.assertEquals( BigInteger.ONE, op.evaluateBinary(8, 8, ff.getEncoding(FloatFormat.BIG_NEGATIVE_INFINITY), ff.getEncoding(FloatFormat.BIG_NEGATIVE_INFINITY))); Assert.assertEquals( BigInteger.ZERO, op.evaluateBinary(8, 8, ff.getEncoding(FloatFormat.BIG_POSITIVE_INFINITY), ff.getEncoding(FloatFormat.BIG_NaN))); }