Re: Win32lib problem

new topic     » goto parent     » topic index » view thread      » older message » newer message

DB James wrote:
 
> But getRandInt() sends an atom as a seed in its call to 
> set_rand() [set_rand(w32Seed)] and that triggers the error:

You are correct. Even though the w32Seed is kept as a 32-bit integer, the
Euphoria set_rand() expects no more than 30-bit positive integers.

Add this line just before the calls to set_rand() in getRandInt...

    w32Seed = remainder(w32Seed, #1F000000)

This will constain the seed value to positive integers up to 30-bits long.

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu