comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Reading IEEE floating point on DEC OpenVMS
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Reading IEEE floating point on DEC OpenVMS [message #4269 is a reply to message #4232] Thu, 18 May 1995 00:00 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
system@ir.phys.chem.ethz.ch (Ulrich Schmitt, Phys. Chem., ETH Zurich) writes:

> Is there a way in PV-WAVE or IDL for DEC OpenVMS to read an unformatted
> external data file which contains IEEE 4-byte and 8-byte floating point
> numbers?

> I assume this involves conversion from IEEE representation to the
> default internal VAX or AXP representation (F_floating for single
> precision and D_floating (VAX) or G_floating (AXP) for double precision).

> ------------------------------------------------------------ ------------
> Ulrich Schmitt | Phone: +41 1 632 4440
> Laboratorium fur Phys. Chemie | Fax: +41 1 632 1021
> ETH Zurich (Zentrum) | E-Mail: schmitt@ir.phys.chem.ethz.ch
> CH-8092 Zurich, Switzerland | ulsi@debye.vmsmail.ethz.ch
> ------------------------------------------------------------ ------------

Look at the routines IEEE_TO_HOST and HOST_TO_IEEE available from the Astronomy
User's Library at URL

ftp://idlastro.gsfc.nasa.gov/pro/misc/

These routines use BYTE_ORDER routine with the appropriate keywords to do the
conversion. Note that this assumes that the IEEE values have the standard
byteorder. If you're trying to read values that were written on a machine that
uses a reversed byte order, such as Ultrix or OSF, then you may need to reverse
the bytes first before applying IEEE_TO_HOST.

The best thing to do, if you can manage it, is to use HOST_TO_IEEE on the data
before writing it, and then you can use IEEE_TO_HOST on any other machine to
read it. That way, you never have to worry about differences in byte-ordering
or data representation between machines.

IDL only supports F_float and D_float representations. In OpenVMS, it uses the
same data representations on both VAX and AXP platforms.

Bill Thompson
[Message index]
 
Read Message
Read Message
Previous Topic: IEEE Standard 754 floating point number
Next Topic: Re: IDL excels in debugging??? Do you know something I dont?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Nov 29 17:42:38 PST 2025

Total time taken to generate the page: 0.00241 seconds