[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

2013.0. "FlopView - floating point display" by NETCAD::ROLKE (The Moodus Noises) Tue Nov 14 1995 13:02

I'd like to share a little tool I've written.  This is a Windows program that
decodes a hexadecimal value in a floating point format and displays the
resulting decimal value in infinite precision.  

I've waded through D- and G-Floating numbers before and this tool makes it
extremely convenient to see just what number a floating pattern represents. 
Plus, I love to make my computer spin its brains out computing things for me
and this fits that bill nicely.

This was a spare time job and unrelated to my real work so it hasn't 
been productized. I learned a little windows programming and I've finally
exposed floating point numbers at least for myself.  It was fun to write
and I hope you have fun running it, too.

Copy the files... 

    from 1) via anonymous (no password) ftp from node cwalti.lkg.dec.com  
	(16.20.108.30)

	file: flopv\flopvx17.zip

	or files:	flopv\kitsrc\flopv.exe
	(unzipped)	flopv\kitsrc\vbrun200.exe
			flopv\kitsrc\relnot.txt
			flopv\kitsrc\uguide.txt

    or 2) via decnet copy from NETCAD::USER$457:[rolke.public.flopv]*.*

The NETCAD directory has all five files so copy what you need.

The next two replies to this note are the User's Guide and Release Notes.

Regards,
Chuck
T.RTitleUserPersonal
Name
DateLines
2013.1FlopView User GuideNETCAD::ROLKEThe Moodus NoisesTue Nov 14 1995 13:06176
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
2013.2FlopView Release NotesNETCAD::ROLKEThe Moodus NoisesTue Nov 14 1995 13:0822
FlopView X1.7 is a Visual Basic 2.0 program.  It will run under 
DOS/Windows 3.x, x86 Windows NT and Alpha Windows NT.

To install this program on your system copy the file FLOPVX17.ZIP
to a working directory and unzip it:

	PKUNZIP -e FLOPVX17.ZIP

This will create several files:

	FLOPV.EXE	- the program
	VBRUN200.DLL	- Visual Basic support code
	UGUIDE.TXT	- user guide
	RELNOT.TXT	- release notes (this file)

Using File Manager you may drag Flopv.exe to a Program Manager group
to create a runnable icon.  And away you go!

FlopView has at least one bug.  If you push enough buttons then you
get a stack overflow.  Sorry about that.

Have fun.