// The "TestMinifloat" class. import hsa.*; public class TestMinifloat { public static void main (String [] args) { // Place your code here System.out.println ("The MiniFloats"); System.out.println ("=============="); System.out.println ("\nBits\t\tValues"); for (char c7 = '0' ; c7 <= '1' ; c7++) for (char c6 = '0' ; c6 <= '1' ; c6++) for (char c5 = '0' ; c5 <= '1' ; c5++) for (char c4 = '0' ; c4 <= '1' ; c4++) for (char c3 = '0' ; c3 <= '1' ; c3++) for (char c2 = '0' ; c2 <= '1' ; c2++) for (char c1 = '0' ; c1 <= '1' ; c1++) for (char c0 = '0' ; c0 <= '1' ; c0++) { char testBits [] = { c7, c6, c5, c4, c3, c2, c1, c0 } ; Minifloat x = Minifloat.bitsToMinifloat (testBits); System.out.println ( x.getBitString () + "\t" + x); } System.out.print ("\nEnter a minifloat value: "); Minifloat x = new Minifloat (Stdin.readDouble ()); System.out.print ("\nEnter another: "); Minifloat y = new Minifloat (Stdin.readDouble ()); Minifloat z = new Minifloat (x.getValue ()); z.add (y); System.out.println ("\n" + x + " + " + y + " == " + z); } // main method } // TestMinifloat class