[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Floating point representation

In system 36.6 Ether, with microcode 683, on Xerox Machine 1:

I had to write some code to convert floating-point numbers to BCPL
floating-point format so that I could output splines to PRESS files (if
you have already done this I would like to look at your code).  In the
process I discovered some strangeness in the representation.  It seems
to me that the floating-point representation of all negative integers is off
in the bottom bit, is there some reason for this?  One would expect
that the reader could do better.

For example, -2e0 is represented as:

(describe -2e0)
-2.0 is a flonum.
  Excess-2000 exponent 2001, 32-bit mantissa 20000000000 (including sign)
  (The mantissa is less than one in the bottom bit position, result is multiplied by 2.)

While a more accurate representation would be:

  Excess-2000 exponent 2002, 32-bit mantissa 27777777777 (including sign)
  (The mantissa is exactly 1/2, result is multiplied by 4.)