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

Home » Public Forums » archive » random integers between 0 and 1,000,000
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
random integers between 0 and 1,000,000 [message #45972] Sat, 22 October 2005 19:29 Go to previous message
mxd1007 is currently offline  mxd1007
Messages: 3
Registered: October 2005
Junior Member
Hello,
I'm trying to generate 30 random integer numbers between 0 and
1,000,000 but I keep getting negative values. This is my IDL
statements:

FOR i = 0, 29 DO BEGIN


weights[i] = ULONG(1000000 * RANDOMU( seed, 1 ))

ENDFOR



the result when I print out the array weights:

17925 28066 15706 -4558 7450 9892 5340 -1674 -29667
-15997
-27046 -27854 -24859 29529 -31310 -7807 21139 8014 -14189
-24471
-16476 -6624 -23456 3042 30319 -20737 10945 -19432 3206
-11725

I would think if you cast ULONG onto the calculation, you would get
postitive values.
thanks in advance.

-Mike
[Message index]
 
Read Message
Read Message
Previous Topic: Re: coordinates in threedimensional object graphics ?
Next Topic: another Dumb Widget question...

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

Current Time: Wed Oct 08 19:31:05 PDT 2025

Total time taken to generate the page: 0.00535 seconds