| FlopView X1.7 November 13, 1995
Introduction
Welcome to FlopView, a floating point number visualization tool.
The purpose of FlopView is to show you exactly the decimal value
which is represented by a binary floating point value. FlopView
interprets the following formats:
32-bit numbers
VAX F Floating
IEEE Single
Microsoft Short
8087 Short Real
64-bit numbers
VAX D Floating
VAX G Floating
IEEE Double
Microsoft Long
8087 Long Real
80-bit numbers
8087 Temporary Real
128-bit numbers
VAX H Floating
Table 1 - FlopView floating point formats
How FlopView Works
When you start FlopView you are presented with an array of
buttons. Press one of the buttons to work with one of the
data sizes. For example, let's press the 32-bit button to
work with 32-bit floating point numbers.
Now you are shown the 32-bit screen. At the top you have
the raw value interpreted in the currently selected format.
You will see a "result" window that looks like this:
+----------------------------------------------+
| 00004080 | Raw Hex Value |
| | Format: VAX F FLoating |
| 00008000 | Sign mask |
| 00007F80 | Exponent mask |
| FFFF007F | Mantissa mask |
| |
| Exponent = 1 |
| Mantissa = 0.5 |
| |
| 1.0 |
+----------------------------------------------+
This window shows you the raw value and the format. It
also shows you the bit fields which are used to interpret
the raw value; these include the sign, exponent and
mantissa fields. Next you get a preliminary interpretation
of the raw value in the exponent and mantissa display.
Finally you get the answer number.
In the "Floating Point Format" window below the result
window you are given a list of floating point formats.
To see the raw hex value displayed in a different format
you just press the radio button for that format. Let's
say you press the "IEEE Single" button. The result
window immediately changes to:
+----------------------------------------------+
| 00004080 | Raw Hex Value |
| | Format: IEEE Single |
| 80000000 | Sign mask |
| 7F800000 | Exponent mask |
| 007FFFFF | Mantissa mask |
| |
| Exponent =-126 |
| Mantissa = 0.0019683837890625 |
| |
| 0.0000000000000000000000000000000000000000231|
| 382402429313794750926228792830951596996851842|
| 650284232527115035882303573089302517473697662|
| 353515625 |
+----------------------------------------------+
Note that the result is huge. It is wrapped in the result
window and you can use a vertical elevator to scroll through
result if it is to big to see all at once.
There is also a set of action buttons. With these you can
1) enter a new raw binary value, 2) Paste the contents of
the result window to the clipboard, and 3) exit back to
the main FlopView window.
Entering a new binary value
When you enter a new binary value you are prompted
with the current value. You may edit the value as
you wish but the "OK" button will only light up
when you have the correct number of hexadecimal digits
in the edit window. Initially FlopView puts
spaces between longwords but you may place spaces
between words or bytes or wherever you like. FlopView
ignores spaces in the edit window.
When you press "OK" then FlopView starts calculating your
answer. Some calculations may take a while and FlopView will
consume your CPU while it is calculating. To help you see
what FlopView is doing you get a down-counter showing how many
calculations are left. You also get a cancel button to kill
the current calculation if you lose patience. The worst
numbers to calculate are small mantissas to large negative
exponents. My 66MHz 486DX2 will take six minutes to calculate
the smallest possible 128-bit VAX H floating point number.
Paste the contents of the result window to the clipboard
When you execute the paste function the clipboard is
cleared and the result window text is put on the
clipboard. The text then may be retrieved by any word
processing program. The fields of the result window are
separated by CR/LF pairs. The result number itself is
one huge string (20,000+ characters, possibly!) and is
not broken by spaces or newlines.
Exit back to FlopView
When you exit to FlopView your raw binary value is
preserved for that data size. Each data size has its
own value and is not affected by the other sizes.
When you exit FlopView then all of your data values are
disposed.
Representing the various formats (endian issues)
FlopView has a curious mixture of big- and little-endian format
issues. For the 32-bit types there is just a longword and not
much problem. For the rest of the types there are multiple
longwords and it might not be clear how to represent a given
format.
For VAX floating point types I used the 'VAX Architecture
Reference Manual' definition of fields. In FlopView the "first"
longword is on the left and other longwords follow.
For the rest of the types the most significant bit is on the
left and the least significant bit is on the right.
To help you enter the correct binary values FlopView shows the
sign, exponent and mask fields for each format. This is a
major clue about how FlopView will interpret your input.
Why FlopView was developed
Over the years I've seen no end to the problems caused by
imprecise representations of floating point values. "My program
clearly states 'if (a == b) do_this();'. a=1.10 and b=1.10
so why doesn't my program call do_this()?" Any serious floating
point programmer has learned to deal with how this stuff works.
I've always wanted to see the exact floating point answers,
no holds barred.
Support agreement
You must be kidding? I would like to add more floating point
formats; if you have any then send me the details. Also, I'm
happy to correct any bugs you find.
Licensing
FlopView is given to you as-is. Enjoy it. You don't need a
license to run it or give it to away. However, I'll be upset if
you modify it.
Regards,
Chuck Rolke
Rolke Associates
53 Union St.
Millis, MA 02054-1246 USA
|