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

Home » Public Forums » archive » Re: Routine for converting 80x87 doubles to XDR (IEEE) format?
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: Routine for converting 80x87 doubles to XDR (IEEE) format? [message #1169] Wed, 07 July 1993 12:53 Go to previous message
ryba is currently offline  ryba
Messages: 33
Registered: October 1992
Member
In article <1993Jul6.212653.13279@ll.mit.edu>, ryba@ll.mit.edu (Marty Ryba) writes:
|> I'd like to read in some data dumped from a PC that includes some
|> 8-byte reals. BYTEORDER only does byte swaps for shorts (2 bytes) and
|> longs (4 bytes). If I recall, the 80x87 uses IEEE format, but with the
|> "little endian" format of the Intel chip. Is that correct? If so, I just
|> need an extended byte-order to do an 8-byte swap. If not, a canned routine
|> to do the conversion would be nice.

Thanks to Bill Thompson and some other reading, here's the result:

pro dblswap,arr
; Procedure to byte-swap 8-byte reals

sa = size(arr)
atype = sa(sa(0)+1)
if atype ne 5 then message,'Only for double precision numbers!'
npts = sa(sa(0)+2)
temp = byte(arr,0,8,npts) ; Convert to bytes
temp = rotate(temporary(temp),5) ; Matrix rotation
arr(0) = double(temp,0,npts) ; Convert back to double

return
end

--
Dr. Marty Ryba | Generation X:
MIT Lincoln Laboratory | Too young to be cynical,
ryba@ll.mit.edu | too old to be optimistic.
Of course nothing I say here is official policy!!!!
[Message index]
 
Read Message
Read Message
Previous Topic: Header,Footer,Etc...
Next Topic: PCX Reader for IDL

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

Current Time: Fri Oct 10 15:57:48 PDT 2025

Total time taken to generate the page: 0.87946 seconds