🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #12869

Random number Generator wanted.

#12869
From: Koos Remigius
Date: Thu, 28 Jun 1990 14:49
29 lines
1620 bytes
Hi there,

I have a question about random numbes generators.
I have found a random number that gives me a random integer.

This function gives me a random integer ( between 0 and range ). 
=================================================================
function Randomize(range:Integer):Integer;
var
  rawResult:LongInt;		{ "Raw" random number received from toolbox }
  begin  { Randomize }		
    rawResult:=(ABS(Random);	{ Get random number between 0 and 32767 }
    Randomize:=(rawResult * range) div 32768;	{ Scale to specified range }
  end;    { Randomize }
=================================================================

What I need is a random number generator that gives me a random LongInt back.
The random number I want must lis between 0 and 2097151.
I any of you out there has an idee how to do this, and willing to
share your idee, than you can make me verry happy.
I' am using Think Pascal for the Macintosh. 
Greetings from Holland,
Koos Remigius.

-- 
Koos Remigius				      kr@mh.nl via internet backbones
Asac Nederland B.V		              uucp: ..!{uunet,hp4nl}!mh.nl!kr
Coencoop 7, 2741 PG Waddinxveen,  The Netherlands
-------------------- "Still crazy after all this years" ---------------------
Technical Details
Message-ID: <152@asacsg.mh.nl>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!mhres!asacsg!kr

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!mhres!asacsg!kr
From: kr@asacsg.mh.nl (Koos Remigius)
Newsgroups: comp.sys.mac,comp.sys.mac.programmer,comp.sys.mac.misc,comp.sys.mac.system
Subject: Random number Generator wanted.
Keywords: Random number
Message-ID: <152@asacsg.mh.nl>
Date: 28 Jun 90 14:49:01 GMT
Organization: Multihouse NV, the Netherlands
Lines: 29