//  -----------------------------------------------------------------
//  -------  Programm   Gleitkomma                   ----------------
//  -------  Numerische Mathematik                   ----------------
//  -------  Ic 01                                   ----------------
//  -------  Float-Darstellung                       ----------------
//  -------  Uebung 3.1  Aufgabe 5.)                 ----------------
//  -------                                          ----------------
//  -------  2002 Oktober 23     M.Vogel             ----------------
//  -----------------------------------------------------------------
import java.lang.*;

public class Gleitkomma
{
   static public void main( String[] args )  
   {   
// ------------------------------------------------------------------      
// -----------        Gleitkommadarstellung            --------------      
// ------------------------------------------------------------------      
      float  xf                                        ;
      double xd                                        ;
      
      InOut.println("")                                ;
      InOut.println("Double-Zahl einlesen ")           ;
      InOut.println("")                                ;
      xd = InOut.getDouble()                           ;                         

	  xf = (float) xd                                  ;
 
      Float flo = new Float(xf)                        ;
  
      int bit = flo.floatToIntBits(xf)                 ;
      Integer ii= new Integer(bit)                     ;

      InOut.println("")                                ;
      InOut.println(xd,3,15)                           ;
      InOut.println(xf,3,9)                            ;
      InOut.print("  ")                                ;
      InOut.println(xf)                                ;
      InOut.println("  "+bit+"  (Integer-number)")     ;
      String s = ii.toBinaryString(bit)                ;
      InOut.println("  "+s+"   (binary string)")       ;

	  bit++                                            ;
      float fl = flo.intBitsToFloat(bit)               ;
      InOut.println("")                                ;
      InOut.print("Next float number ")                ;
      InOut.println(fl,3,9)                            ;
      InOut.print("  ")                                ;
      InOut.println(fl)                                ;
      InOut.println("  "+bit+"  (Integer-number)")     ;

    }  
}
