Re: A bug in Mac OS version? [message #13858] |
Tue, 15 December 1998 00:00 |
Richard G. French
Messages: 65 Registered: June 1997
|
Member |
|
|
Saeid Zoonematkermani wrote:
>
> Hello,
>
> This is a rather curious bug that I noticed after I upgraded to 5.2. Of
> course this may not be a bug but if I am being really stupid, please let
> me know.
>
> IDL> print, !version
> { PowerMac MacOS MacOS 5.2 Oct 30 1998}
> IDL> print, '0000FF'x
> 255
> IDL> print, '00FF00'x
> -256
> IDL> print, 'FF0000'x
> 16711680
>
> Shouldn't '00FF00'x be equivalent to 65280? Is this behavior also repeated
> on other platforms?
>
>
on my 5.1 version, i do indeed get 65280:
IDL> print, '00FF00'x
65280
IDL> print,!version
{ alpha OSF unix 5.1 Apr 13 1998}
|
|
|
Re: A bug in Mac OS version? [message #13859 is a reply to message #13858] |
Tue, 15 December 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Olof Hellman (hellman@ksan.ms.nwu.edu) writes:
> I would agree with you that
>
> IDL> print, '00FF00'x
> -256
>
> might be reasonable, but then I'd expect
>
> IDL> print, 'FF0000'x
> 0
>
> If the behaviour shown above isn't wrong, then IDL is a very perverse language.
Perverse!? IDL? *Our* IDL? The one we use the make filled contour plots?
Nah... :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Progamming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: A bug in Mac OS version? [message #13860 is a reply to message #13858] |
Tue, 15 December 1998 00:00  |
hellman
Messages: 4 Registered: September 1998
|
Junior Member |
|
|
In article <MPG.10e0810a9c715cf9896ad@news.frii.com>, davidf@dfanning.com
(David Fanning) wrote:
> Saeid Zoonematkermani (Saeid.Zoonematkermani@sunysb.edu) writes:
>
>> IDL> print, !version
>> { PowerMac MacOS MacOS 5.2 Oct 30 1998}
>> IDL> print, '0000FF'x
>> 255
>> IDL> print, '00FF00'x
>> -256
>> IDL> print, 'FF0000'x
>> 16711680
>
> In fact, this value you are trying to create here is really
> a LONG integer. You, of course, are creating it as a SHORT
> integer. Now, I'll give you that IDL didn't used to behave
> so boarishly, but what it is doing (i.e. wrapping), IMHO,
> is entirely within its rights.
I would agree with you that
IDL> print, '00FF00'x
-256
might be reasonable, but then I'd expect
IDL> print, 'FF0000'x
0
If the behaviour shown above isn't wrong, then IDL is a very perverse language.
- Olof
|
|
|
Re: A bug in Mac OS version? [message #13862 is a reply to message #13858] |
Tue, 15 December 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Saeid Zoonematkermani (Saeid.Zoonematkermani@sunysb.edu) writes:
> This is a rather curious bug that I noticed after I upgraded to 5.2. Of
> course this may not be a bug but if I am being really stupid, please let
> me know.
>
> IDL> print, !version
> { PowerMac MacOS MacOS 5.2 Oct 30 1998}
> IDL> print, '0000FF'x
> 255
> IDL> print, '00FF00'x
> -256
> IDL> print, 'FF0000'x
> 16711680
>
> Shouldn't '00FF00'x be equivalent to 65280? Is this behavior also repeated
> on other platforms?
Yes, I noticed this the other day too on my Windows NT machine.
I was well into a nasty note to RSI technical support when I
thought to do just a bit more testing.
In fact, this value you are trying to create here is really
a LONG integer. You, of course, are creating it as a SHORT
integer. Now, I'll give you that IDL didn't used to behave
so boarishly, but what it is doing (i.e. wrapping), IMHO,
is entirely within its rights. I'm guessing that something
changed internally with the new unsigned integer stuff.
In any case, you get what you expect if you make these
values LONG integers:
IDL> Print, '00FF00'xL
65280
IDL> Print, 'FF0000'xL
16711680
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Progamming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Note: This follow-up was e-mailed to the cited author.]
|
|
|