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

Home » Public Forums » archive » Re: 31000 + 3000 = -31536 (What is this!)
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: 31000 + 3000 = -31536 (What is this!) [message #308] Mon, 29 June 1992 01:59
wu is currently offline  wu
Messages: 3
Registered: June 1992
Junior Member
In article <1992Jun28.173438.17167@ucsu.Colorado.EDU> Ferhat F. Hatay
(hatay@spot.Colorado.EDU) writes ...
>
> IdlMaster>print, 31000 + 3000
> -31536
>
The problem here is that: IDL treats the two numbers just as "short integer".
We can see it with
IDL> help, 31000 + 3000
<Expression> INT = -31536.

In this case, you can declare the number as a long integer. Now you will have
the right result:
IDL> help, 31000L + 3000
<Expression> LONG = 34000

Xiangchen Wu
email: wu@ipesun.e-technik.uni-stuttgart.de
[Message index]
 
Read Message
Previous Topic: 31000 + 3000 = -31536 (What is this!)
Next Topic: Help needed with HPGL output of IDL

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

Current Time: Sun Oct 12 19:44:41 PDT 2025

Total time taken to generate the page: 1.92513 seconds