Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!cbmvax!carolyn From: carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) Newsgroups: comp.sys.amiga.tech Subject: Re: Questions Message-ID: <3814@cbmvax.UUCP> Date: 18 May 88 15:00:08 GMT References: <97800008@silver> <3779@cbmvax.UUCP> <702@applix.UUCP> Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) Organization: Commodore Technology, West Chester, PA Lines: 27 In article <702@applix.UUCP> scott@applix.UUCP (Scott Evernden) writes: >In article <3779@cbmvax.UUCP> carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) writes: >>> Where can I find the random number routine for use with C? >> >>It's in amiga.lib and it is called RangeRand() and it is documented in the >>amiga.lib.doc in the A-W RKM Exec manual. Usage is RangeRand(n) where n >>is a number from 1 to 65535 and represents the high limit for your random > >Is it true there is no way to seed RangeRand()? Also, what the heck >is the use of FastRand()?? Currently, Amiga.lib has an xdef'd variable called _RangeSeed (in C that would be extern ULONG RangeSeed). It starts out initialized to 0. I think each call to RangeRand updates it. You could set it yourself. There is an _FastRand routine which is commented as a quick way to generate a random number. It wants a 32-bit seed passed on stack, and returns a new 32-bit seed in d0. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Carolyn Scheppner -- CATS >>Commodore Amiga Technical Support<< UUCP ...{allegra,ihnp4,rutgers}!cbmvax!carolyn PHONE 215-431-9180 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=