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

Home » Public Forums » archive » Re: A bug in Mac OS version?
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: A bug in Mac OS version? [message #13862 is a reply to message #13858] Tue, 15 December 1998 00:00 Go to previous message
davidf is currently offline  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.]
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL with multiple processors
Next Topic: A bug in Mac OS version?

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

Current Time: Sun Oct 12 04:49:16 PDT 2025

Total time taken to generate the page: 0.80316 seconds