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

Home » Public Forums » archive » Unsigned Integers - How?
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
Unsigned Integers - How? [message #8149] Wed, 05 February 1997 00:00 Go to next message
Peter Berdeklis is currently offline  Peter Berdeklis
Messages: 3
Registered: February 1997
Junior Member
Hi.

I'm trying to read a binary data file into IDL. Included in the data
headers are several unsigned integers for dates and times. Some of the
unsinged integers are overflowing, giving me negative integers. How do I
specify a variable as an unsinged integer in IDL?

---------------
Peter Berdeklis
Dept. of Physics, Univ. of Toronto
Re: Unsigned Integers - How? [message #8190 is a reply to message #8149] Tue, 11 February 1997 00:00 Go to previous messageGo to next message
sterner is currently offline  sterner
Messages: 106
Registered: February 1991
Senior Member
davidf@dfanning.com (David Fanning) writes:

> Convert them to the correct *unsigned* values, like this:

> date = LONG(date) AND 'FFFF'x

A minor variation:

date = date AND 'FFFF'xL

Ray Sterner sterner@tesla.jhuapl.edu
The Johns Hopkins University North latitude 39.16 degrees.
Applied Physics Laboratory West longitude 76.90 degrees.
Laurel, MD 20723-6099
WWW Home page: http://fermi.jhuapl.edu/s1r/people/res/res.html
Re: unsigned integers [message #12337 is a reply to message #8149] Mon, 20 July 1998 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
David Fanning wrote:
>
> Richard G. French (rfrench@wellesley.edu) writes:
>
>> Does anyone out there know why the unsigned integer type has
>> never been implemented in IDL? Has anyone written a small
>> package of routines to deal with them painlessly? I've always
>> handled on a case-by-case basis by reading the signed shorts into IDL
>> and then converting them to LONG, using the MSB of the short to
>> turn the sign bit into the appropriate power of two. Don't all C
>> compilers have unsigned shorts as a standard type? Is there anyone
>> else out there who would like to see unsigned integers elevated to
>> a legal type?
>
> According to my usually reliable sources, an unsigned
> integer data type is under very strong consideration at
> RSI. It is especially needed to work with much of the data
> coming from EOS missions. I wouldn't be surprised to see it
> in a future upgrade. Customer requests, of course, always
> make a difference.
>

In the meantme, check out an article "Working with unsigned integers"
on David Fanning's web site: www.dfanning.com .

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 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
Re: unsigned integers [message #12350 is a reply to message #8149] Fri, 17 July 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Richard G. French (rfrench@wellesley.edu) writes:

> Does anyone out there know why the unsigned integer type has
> never been implemented in IDL? Has anyone written a small
> package of routines to deal with them painlessly? I've always
> handled on a case-by-case basis by reading the signed shorts into IDL
> and then converting them to LONG, using the MSB of the short to
> turn the sign bit into the appropriate power of two. Don't all C
> compilers have unsigned shorts as a standard type? Is there anyone
> else out there who would like to see unsigned integers elevated to
> a legal type?

According to my usually reliable sources, an unsigned
integer data type is under very strong consideration at
RSI. It is especially needed to work with much of the data
coming from EOS missions. I wouldn't be surprised to see it
in a future upgrade. Customer requests, of course, always
make a difference.

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: [Q] Curved text?
Next Topic: getting data from a pointer

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

Current Time: Fri Oct 10 14:29:56 PDT 2025

Total time taken to generate the page: 1.11992 seconds