Benjamin Rutt wrote:[color=blue]
> Does anyone have C code laying around to do this?
>
> I have to read in some binary data files that contains some 4-byte
> IBM/370 floating point values. I would like a function to convert
> 4-byte IBM/370 float values into IEEE 754 'float' values that I can
> use directly with any modern C environment (that uses IEEE 754).
>
> I can handle endian conversion myself (the files are stored as big
> endian, and I'll process them on a little endian machine), but do not
> have code for converting an in-memory float (that is in the correct
> endianness for the machine) from 370 to IEEE 754. Any help is
> appreciated.[/color]
This question is probably better suited for a group not focused on
Standard C, but check out
http://nssdcftp.gsfc.nasa.gov/miscel...nts/b46645.txt,
specifically the r4ibmieee and r8ibmieee functions. This probably
isn't very portable, but if it doesn't work on your system you can at
least use the algorithm to write your own routine.
Robert Gamble