[comp.sys.dec] IEEE<->DEC floating pt conversion wanted.

alan@shodha.dec.com ( Alan's Home for Wayward Notes File.) (08/24/89)

In article <3741@ncsuvx.ncsu.edu>, brg@ecelet.ncsu.edu (Bennett Groshong) writes:
> I have a need to be able to convert data files containing floating
> point numbers (i.e. 32bit floats and 64bit doubles) between IEEE and
> DEC floating point format. *SOMEONE* has to have written this, yet
> neither I nor any of the wizards here can find such a routine.
> (I've searched the obvious newsgroups and the Ultrix doc.)

	If you have a DECstation or DECsystem there are a
	set of functions in the standard library for doing
	this conversion.  There isn't any documentation that
	I know of though.

	Some of the functions of interest are:

		dtoi - D Float to IEEE
		ftoi - F Float to IEEE
		itod - IEEE to D Float
		itof - IEEE to F Float

	There may also be a set for the G-Float format.  From little
	I've been able to divine they take a point pointer to the
	number and convert it in place.  If it fails it restores
	the original number and returns -1.

> 
> If this is in one of the std libraries/doc, consider me red-faced.
> 

	They're in the library, but without documentation or even
	a man page are hard to track down.

	I don't know whether or not these functions are supported.
	Check with the CSC if you have a support contract to see
	what they can find out.
-- 
Alan Rollow				alan%nabeth.dec.com@decwrl.dec.com

frank@croton.dec.com (Frank Wortner) (08/25/89)

In article <3741@ncsuvx.ncsu.edu>, brg@ecelet.ncsu.edu (Bennett Groshong) writes:

> I have a need to be able to convert data files containing floating
> point numbers (i.e. 32bit floats and 64bit doubles) between IEEE and
> DEC floating point format. 

If you have a DECstation, there is a set of "undocumented" routines
for VAX/IEEE conversion in the standard library.  Details are in
"ULTRIX Release Notes for RISC Processors", Order Number
AA-ML77A-TE.  Look on page 78.

					Frank