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
Re: random integers between 0 and 1,000,000 [message #46038 is a reply to message #45972] Tue, 25 October 2005 02:17 Go to previous message
Norbert Hahn is currently offline  Norbert Hahn
Messages: 46
Registered: May 2003
Member
"James Kuyper" <kuyper@wizard.net> wrote:

> Norbert Hahn wrote:
>> "James Kuyper" <kuyper@wizard.net> wrote:
>>
>>> takes a 32 bit unsigned long with a value somewhere in the range from 0
>>> to 1000000, and converts it into a 16 bit signed int, with a range from
>>> -32768 to 32767.
>>
>> I took a closer look on what might have gone on. I ran the following
>> program:
>>
>> z = randomu(seed,30)
>> a = long (z*1000000) & print, a
>> b = ulong (z*1000000) & print, b
>> i = fix(a)
>> print, a
>>
>> I found that a(1) was negative (-20848). So I printed

Sorry for the typo! The line should read
"I found that i(1) was negative (-20848). So I printed"
--------------|

The hex numbers given in my example were correct with leading zeroes
omitted.

Norbert
[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: Fri Oct 10 00:40:30 PDT 2025

Total time taken to generate the page: 0.31973 seconds