Re: 32-bit random numbers
- Posted by Tommy Carlier <tommy.carlier at pandora.be> Jul 03, 2004
- 549 views
How to create a 32-bit random integer between 1 and n (n = 32-bit integer atom): function rand32(atom n) if n <= #3FFFFFFF then return rand(n) else return rand(n - #3FFFFFFF) + rand(#3FFFFFFF) - 1 end function PS: if you leave out the -1 at the end, the number 1 will never be chosen. -- tommy online: http://users.pandora.be/tommycarlier Euphoria Message Board: http://uboard.proboards32.com