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

Home » Public Forums » archive » Re: Could you explain why this happen?
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: Could you explain why this happen? [message #70708 is a reply to message #70707] Wed, 28 April 2010 10:01 Go to previous message
jeanh is currently offline  jeanh
Messages: 79
Registered: November 2009
Member
On 28/04/2010 12:46 PM, Bryan wrote:
> This may be a stupid question, but I really want to know why.
> Please, see below and explain. Thanks.
>
> IDL> print, 132*30
> 3960
> IDL> print, 132*30*10
> -25936
> IDL> print, 132*300
> -25936
> IDL> data1 = 132
> IDL> data2 = 300
> IDL> data3 = data1*data2
> IDL> print, data3
> -25936

Hi,

you are working with integers, the maximum value being 32 767. When you
go over this limit, IDL goes back to the minimum value (-32 768). So 32
767 + 1 = -32 768
Use long integers instead, and you will have the value you are expecting!

Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to read field attributes in HDF-EOS
Next Topic: ms2gt MODIS reprojection toolkit

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

Current Time: Fri Oct 10 15:11:48 PDT 2025

Total time taken to generate the page: 1.03798 seconds