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

Home » Public Forums » archive » BYTES to LONG
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: BYTES to LONG [message #22419 is a reply to message #22341] Wed, 08 November 2000 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Kelly Dean <krdean@lamar.colostate.edu> writes:

> Thanks Paul,
>
> Your suggestion solved my problem.
>
> long_x = TOTAL( ISHFT( LONG(x), [24,16,8,0] ) )

Hi Kelly--

While this may seem to work, I agree with JD that this is a bit
dangerous since it converts to floating point. The expression

long_x = long(x, 0, 1)

should produce the same, and correct, result, without invoking any
floating point conversions. However you may have to worry about
so-called "endian" issues, that is byte ordering differences between
machines. A routine in the IDL Astronomy Library like IEEE_TO_HOST
should be able to help you there.

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Connected component analysis
Next Topic: Window Background

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

Current Time: Fri Oct 10 20:06:54 PDT 2025

Total time taken to generate the page: 0.48095 seconds