Xref: utzoo comp.unix.ultrix:1575 comp.unix.questions:15930 comp.sys.dec:1726 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!shlump.nac.dec.com!shodha.dec.com!alan From: alan@shodha.dec.com ( Alan's Home for Wayward Notes File.) Newsgroups: comp.unix.ultrix,comp.unix.questions,comp.sys.dec Subject: Re: IEEE<->DEC floating pt conversion wanted. Summary: It's sort of there. Keywords: IEEE to DEC, floating point conversion, float format, C routine Message-ID: <391@shodha.dec.com> Date: 24 Aug 89 16:35:33 GMT References: <3741@ncsuvx.ncsu.edu> Followup-To: comp.unix.ultrix Distribution: usa Organization: Digital Equipment Corp. - Colorado Springs, CO. Lines: 36 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