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

Home » Public Forums » archive » Re: Simple overflow error
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
Re: Simple overflow error [message #33770] Wed, 29 January 2003 09:33
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
I get a feeling you don't really care what the data type is in this case.
Try
a = 200. * 200
Cheers,
Pavel

New2IDL wrote:
>
> HI,
> I have a small problem with overflow.
>
> a = 200 * 200
> print, a
>
> I get the answer as a negative no. can anybody please tell me how to fix this.
>
> Thanks
Re: Simple overflow error [message #33774 is a reply to message #33770] Tue, 28 January 2003 15:32 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Mike Chinander" <mchinand@midway.uchicago.edu> wrote:
> New2IDL <biomedthesis2002@yahoo.com> wrote:
>
>> I have a small problem with overflow.
>>
>> a = 200 * 200
>>
>> I get the answer as a negative no. can anybody please tell me how
>> to fix this.
>
> Make at least one of your integers a LONG .
>
> a=200L*200

Or, in recent IDL versions, include a "compile_opt IDL2" or
"compile_opt DEFINT32" command at the start of each program unit. If
you put one in your startup file it sets the options for expressions
you type in at the command line.

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: Simple overflow error [message #33775 is a reply to message #33774] Tue, 28 January 2003 15:19 Go to previous message
mchinand is currently offline  mchinand
Messages: 66
Registered: September 1996
Member
In article <162586e3.0301281512.3d87e978@posting.google.com>,
New2IDL <biomedthesis2002@yahoo.com> wrote:
> HI,
> I have a small problem with overflow.
>
> a = 200 * 200
> print, a
>
> I get the answer as a negative no. can anybody please tell me how to fix this.
>
> Thanks


Make at least one of your integers a LONG .

a=200L*200
print, a
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: WHERE - problem
Next Topic: Re: MOUSE (WHEEL) BUTTON NON-STOP SCROLLING IN IDL 5.6

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

Current Time: Fri Oct 10 10:30:40 PDT 2025

Total time taken to generate the page: 0.56046 seconds