### Question:
OpBehaviorFloatNeg extends UnaryOpBehavior { @Override public long evaluateUnary(int sizeout, int sizein, long in1) { FloatFormat format = FloatFormatFactory.getFloatFormat(sizein); return format.opNeg(in1); } OpBehaviorFloatNeg(); @Override long evaluateUnary(int sizeout, int sizein, long in1); @Override BigInteger evaluateUnary(int sizeout, int sizein, BigInteger in1);  }### Answer:
@Test public void testEvaluateBinaryLong() { OpBehaviorFloatNeg op = new OpBehaviorFloatNeg(); FloatFormat ff = FloatFormatFactory.getFloatFormat(8); long a = ff.getEncoding(2.5); long result = op.evaluateUnary(8, 8, a); Assert.assertEquals(-2.5, ff.getHostFloat(result), 0); a = ff.getEncoding(-2.5); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(2.5, ff.getHostFloat(result), 0); a = ff.getEncoding(Double.POSITIVE_INFINITY); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(Double.NEGATIVE_INFINITY, ff.getHostFloat(result), 0); a = ff.getEncoding(Double.NEGATIVE_INFINITY); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(Double.POSITIVE_INFINITY, ff.getHostFloat(result), 0); a = ff.getEncoding(Double.NaN); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(Double.NaN, ff.getHostFloat(result), 0); }
@Test public void testEvaluateBinaryBigInteger() { OpBehaviorFloatNeg op = new OpBehaviorFloatNeg(); FloatFormat ff = FloatFormatFactory.getFloatFormat(8); BigInteger a = ff.getEncoding(BigDecimal.valueOf(2.5d)); BigInteger result = op.evaluateUnary(8, 8, a); Assert.assertEquals(BigDecimal.valueOf(-2.5d), ff.getHostFloat(result)); a = ff.getEncoding(BigDecimal.valueOf(-2.5d)); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(BigDecimal.valueOf(2.5d), ff.getHostFloat(result)); a = ff.getEncoding(FloatFormat.BIG_POSITIVE_INFINITY); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(FloatFormat.BIG_NEGATIVE_INFINITY, ff.getHostFloat(result)); a = ff.getEncoding(FloatFormat.BIG_NEGATIVE_INFINITY); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(FloatFormat.BIG_POSITIVE_INFINITY, ff.getHostFloat(result)); a = ff.getEncoding(FloatFormat.BIG_NaN); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(FloatFormat.BIG_NaN, ff.getHostFloat(result)); }