### Question:
OpBehaviorFloatFloat2Float extends UnaryOpBehavior { @Override public long evaluateUnary(int sizeout, int sizein, long in1) { FloatFormat formatout = FloatFormatFactory.getFloatFormat(sizeout); FloatFormat formatin = FloatFormatFactory.getFloatFormat(sizein); return formatin.opFloat2Float(in1, formatout); } OpBehaviorFloatFloat2Float(); @Override long evaluateUnary(int sizeout, int sizein, long in1); @Override BigInteger evaluateUnary(int sizeout, int sizein, BigInteger in1);  }### Answer:
@Test public void testEvaluateBinaryLong() { OpBehaviorFloatFloat2Float op = new OpBehaviorFloatFloat2Float(); FloatFormat ff8 = FloatFormatFactory.getFloatFormat(8); FloatFormat ff4 = FloatFormatFactory.getFloatFormat(4); long a = ff4.getEncoding(1.75); long result = op.evaluateUnary(8, 4, a); Assert.assertEquals(1.75, ff8.getHostFloat(result), 0); a = ff4.getEncoding(-1.75); result = op.evaluateUnary(8, 4, a); Assert.assertEquals(-1.75, ff8.getHostFloat(result), 0); a = ff4.getEncoding(Float.POSITIVE_INFINITY); result = op.evaluateUnary(8, 4, a); Assert.assertEquals(Double.POSITIVE_INFINITY, ff8.getHostFloat(result), 0); a = ff4.getEncoding(Float.NEGATIVE_INFINITY); result = op.evaluateUnary(8, 4, a); Assert.assertEquals(Double.NEGATIVE_INFINITY, ff8.getHostFloat(result), 0); a = ff4.getEncoding(Float.NaN); result = op.evaluateUnary(8, 4, a); Assert.assertEquals(Double.NaN, ff8.getHostFloat(result), 0); }
@Test public void testEvaluateBinaryBigInteger() { OpBehaviorFloatFloat2Float op = new OpBehaviorFloatFloat2Float(); FloatFormat ff8 = FloatFormatFactory.getFloatFormat(8); FloatFormat ff4 = FloatFormatFactory.getFloatFormat(4); BigInteger a = ff4.getEncoding(BigDecimal.valueOf(1.75d)); BigInteger result = op.evaluateUnary(8, 4, a); Assert.assertEquals(BigDecimal.valueOf(1.75d), ff8.getHostFloat(result)); a = ff4.getEncoding(BigDecimal.valueOf(-1.75d)); result = op.evaluateUnary(8, 4, a); Assert.assertEquals(BigDecimal.valueOf(-1.75d), ff8.getHostFloat(result)); a = ff4.getEncoding(FloatFormat.BIG_POSITIVE_INFINITY); result = op.evaluateUnary(8, 4, a); Assert.assertEquals(FloatFormat.BIG_POSITIVE_INFINITY, ff8.getHostFloat(result)); a = ff4.getEncoding(FloatFormat.BIG_NEGATIVE_INFINITY); result = op.evaluateUnary(8, 4, a); Assert.assertEquals(FloatFormat.BIG_NEGATIVE_INFINITY, ff8.getHostFloat(result)); a = ff4.getEncoding(FloatFormat.BIG_NaN); result = op.evaluateUnary(8, 4, a); Assert.assertEquals(FloatFormat.BIG_NaN, ff8.getHostFloat(result)); }