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

Home » Public Forums » archive » Re: READU on IRIX and Win95, Big Endian, Little Endian
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: READU on IRIX and Win95, Big Endian, Little Endian [message #16342] Tue, 20 July 1999 00:00
Paul O Storaasli is currently offline  Paul O Storaasli
Messages: 2
Registered: July 1999
Junior Member
Well, Paul, SGI's along with most Unix Computers are Big endian, while
PCs are little endian. To tell
what type your computer is, you can use the following few lines, taken
from David Fanning's commentary on this subject
(http://www.dfanning.com/tips/endian_machines.html):
little_endian = (BYTE(1, 0, 1))[0]
IF (little_endian) THEN $
Print, "I'm little endian." ELSE $
Print, "I'm big endian."

If you want to read data from a Big Endian machine, on a little endian
machine, you might want to place the following
line in your code after you have read the data:

IF ((BYTE(1, 0, 1))[0]) THEN variablename= SWAP_ENDIAN(variablename)


Paul Storaasli
Raytheon Systems Company
postoraasli@west.raytheon.com


Paul O Storaasli wrote:

> When I use READU on the same file in Win95 and IRIX, I get different
> results.
> Is this possible? How would I read the file on a Win95 system?
> I am trying to read a binary file of 32-bit floats with the following
> code:
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Mac top level widget
Next Topic: READU on IRX and Win95

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

Current Time: Wed Oct 08 18:14:16 PDT 2025

Total time taken to generate the page: 0.00629 seconds