Re: MSB, LSB? [message #14441] |
Thu, 04 March 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
David Fanning (davidf@dfanning.com) writes:
>> Height = MSB(most significant bits) * 256 + LSB(least significant bits)
Whoops! I wrote:
> height = Byte(data, 0) * 256 + Byte(data, 1)
And I probably should have written:
height = Byte(data, 1) * 256 + Byte(data, 0)
I think I wrote my test number incorrectly. :-(
You also have to pay attention to where this data was
created and what kind of machine you are working on.
For example, if this data was created on a UNIX machine
and I'm reading it on my PC, then I have to swap the
MSB and LSB when I read the data file.
OpenR, lun, filename, /Get_Lun, /Swap_If_Little_Endian
Cheers,
David
P.S. I promise in the future to get my kids off to school
BEFORE I start answering questions on the newsgroup. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|