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

Home » Public Forums » archive » Re: Unsigned Integers - How?
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: Unsigned Integers - How? [message #8120 is a reply to message #8115] Fri, 07 February 1997 00:00 Go to previous messageGo to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
David Foster wrote:
>> David Fanning wrote:
>>
>> Read the unsinged integers into *signed* 16-bit integers in IDL.
>> (You are already doing this, apparently).
>>
>> date = 0L
>> time = 0L
>> READU, lun, datafile, date, time
>>
>> Convert them to the correct *unsigned* values, like this:
>>
>> date = LONG(date) AND 'FFFF'x
>> time = LONG(time) AND 'FFFF'x
>>
>
> Oops! If you specify LONG then you get 32-bit integers. So:
>
> date = fix(0)
> time = fix(0)
> readu, lun, datafile, date, time
>
> date = date AND 'FFFF'x
> time = time AND 'FFFF'x
>

Double oops! Low voltage day or what!! Sorry about this noise.
I just meant that you need 16-bit integers when you read the
integers from the file (I'm assuming we're talking about shorts).
Of course, the last two lines should read:

date = long(date) AND 'FFFF'x
time = long(time) AND 'FFFF'x

as David Fanning suggested.

Sorry Dave.



--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2200
La Jolla, CA 92037
[ UCSD Mail Code 0949 ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: UNsigned Integer Data
Next Topic: Re: IDL 5.0 news at RSI website *correction*

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

Current Time: Fri Oct 10 01:34:30 PDT 2025

Total time taken to generate the page: 0.80209 seconds