Unsigned Integers - How? [message #8149] |
Wed, 05 February 1997 00:00  |
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 [message #12337 is a reply to message #8149] |
Mon, 20 July 1998 00:00  |
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  |
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/
|
|
|