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

Home » Public Forums » archive » Re: Pack a Float into Bytes
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: Pack a Float into Bytes [message #76439 is a reply to message #76437] Thu, 02 June 2011 09:12 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Wayne Landsman writes:

>
> Is this what you mean?
>
> b = byte(!pi,0,4) ;Convert !pi to a byte array
> print,float(b,0,1) ;Convert back to a floating point number

Wayne, could I do the packing on a little endian
machine and expect the byte array to be unpacked
properly on a big endian machine? Or, would I have
to flip the bytes in this case?

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 8 on a Laptop
Next Topic: Re: IDL 8 on a Laptop

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

Current Time: Wed Oct 08 17:07:05 PDT 2025

Total time taken to generate the page: 0.00473 seconds