Viewing Floating-Point Representations with BitViewer

The BitViewer utility lets you view the binary representation of real numbers in single and double format. To access this tool from the command line, type the command BITVIEW. By default, Visual Fortran installs the BitViewer utility in the folder ...\Microsoft Visual Studio\Df98\BIN.

The following figure shows the logical layout of the single and double formats. The figure shows the contents of each field, its width, and the location of the most significant bit (MSB) and the least significant bit (LSB).

Logical Structure of the IEEE Single and Double Formats

To view floating-point numbers in BitViewer, open the Data Type menu, then choose Floating-Point Real (or use the F9 shortcut key). Set the precision by selecting one of the choices in the Bytes box. Four bytes, REAL(4), displays the number in single format (23-bit precision). Eight bytes, REAL(8), displays the number in double format (52-bit precision). The following figures show the BitViewer display of the memory storage for a 4-byte real number and an 8-byte real number, both equal to 12.6. In the double format display, the most significant part is on the bottom and the least significant 32 bits above.

Single Format in BitViewer

Double Format in BitViewer


Note: BitViewer lets you view and manipulate integer and character data as well as floating-point, and to translate between different data types. Refer to the BitViewer online Help file (Help menu) for more information.