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

Home » Public Forums » archive » Re: Negative values with incrementation
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: Negative values with incrementation [message #70939] Thu, 20 May 2010 20:53
Suguru Amakubo is currently offline  Suguru Amakubo
Messages: 24
Registered: March 2010
Junior Member
That solved the problem thank you :)

Suguru
Re: Negative values with incrementation [message #70941 is a reply to message #70939] Thu, 20 May 2010 17:49 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Suguru Amakubo writes:

> First time round, it gave me a positive number of void as expected and
> I increased the number of points scattered however when I have done so
> the number of void became negative.
> ...
> coverage is a 400x400 matrice containing the number of reference
> points scattered on a certain pixel.
>
> and the output was:
>
> IDL> print, void_point
> -2469
>
> the number of points scattered was 3015 (checked using help)
>
> Any idea why this happens?

You have exceeded the value of a short 16-bit integer.
Make your counting variable a long integer:

void_point = 0L

Or, better yet, make *all* your integers longs by putting
this statement in all of your programs:

Compile_Opt defint32

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Checking my work: PERCENTILES.PRO
Next Topic: Re: Why do I get the string in ytitle in vertical direction

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

Current Time: Wed Oct 08 15:38:00 PDT 2025

Total time taken to generate the page: 0.00548 seconds