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

Re: [MacPerl] Getting floating point numbers from binary files



Christopher F. Blanford (blanf001@tc.umn.edu) wrote:

>I'm trying to convert binary files from a pre-MS-DOS computer (it even has
>8 inch floppies) into comma-separated ASCII values. In these files are
>32-bit real numbers (in IEEE format, i.e., 1 bit sign, 8 bit exponent, 23
>bit remainder) 


Hmmm...I'd tread carefully here.  "pre MS-DOS" sounds like it might
imply "pre-IEEE standard."  IEEE 854 is, I think, dated 1987. There
was a predecessor, IEEE 754, but I don't think it predated 854 by
very many years.  Prior to that, there were very few genuine
standards...everything from the VAX to S/370 to Cray-1 to CDC to
Harris to whatever had its own take on fp representation and
semantics, and sometimes several versions depending on what machine
option you owned.  If you're dealing with a machine old enough to
use 8" diskettes, you've probably got pot luck numbers.

None of this will make much difference if your numbers are just of
the "1.245" variety, but it could make quite a bit of difference if
you're doing matrix computation, numerical analysis, etc., and
assuming a set of numerical or representational properties that
don't really apply to your dataset.

jse

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch