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

Home » Public Forums » archive » - unsigned variables
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 variables [message #41055] Thu, 23 September 2004 15:56
hanswurst247 is currently offline  hanswurst247
Messages: 2
Registered: September 2004
Junior Member
A strange behavior in IDL occured to me.

In C++ if I do:
unsigned short x=1;
printf("%d",-x);
I get
-1
like I would expect.

In IDL however:
x=1U
print, -x
gives
65535
So it basically treats it like I had done:
print, uint(-1)

Does anybody have an explanation for this?
Is this, because of a typecast before executing the print?
(Can creat bugs, which are hard to localize.)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Putting data in a map projection
Next Topic: Re: Top-level bases

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

Current Time: Fri Oct 10 11:41:49 PDT 2025

Total time taken to generate the page: 0.95783 seconds