[comp.sys.mac] Random Numbers is LSC?

zubrow+@andrew.cmu.edu (David Zubrow) (10/20/87)

I could not find any mention of a random number generator in the LSC manual.
Does one exist?  If not, are there any modules out there for implementing
random numbers?

Thanks,

Dave Zubrow
zubrow@c.cs.cmu.edu
zubrow@andrew.cmu.edu

singer@endor.harvard.edu (Richard Siegel) (10/20/87)

In article <cVSpkvy00Uzxh7E05h@andrew.cmu.edu> zubrow+@andrew.cmu.edu (David Zubrow) writes:
>I could not find any mention of a random number generator in the LSC manual.
>Does one exist?  If not, are there any modules out there for implementing
>random numbers?
>

	There is a function in the math library called rand() which returns
a random number; you could also used the QuickDraw function Random() which
returns a random integer in the range -32767...32767.

		-_Rich


**The opinions stated herein are my own opinions and do not necessarily
represent the policies or opinions of my employer (THINK Technologies, Inc).

* Richard M. Siegel | {decvax, ucbvax, sun}!harvard!endor!singer    *
* Customer Support  | singer@endor.harvard.edu			    *
* THINK Technologies, Inc.  (No snappy quote)                       *

stew@endor.harvard.edu (Stew Rubenstein) (10/21/87)

In article <cVSpkvy00Uzxh7E05h@andrew.cmu.edu> zubrow+@andrew.cmu.edu (David Zubrow) writes:
>I could not find any mention of a random number generator in the LSC manual.
>Does one exist?  If not, are there any modules out there for implementing
>random numbers?

There's one in the ROM.  Random().  See Inside Mac I-194.

Stew Rubenstein
Cambridge Scientific Computing, Inc.
UUCPnet:    seismo!harvard!rubenstein            CompuServe: 76525,421
Internet:   rubenstein@harvard.harvard.edu       MCIMail:    CSC

cheeser@dasys1.UUCP (Les Kay) (10/22/87)

In article <cVSpkvy00Uzxh7E05h@andrew.cmu.edu> zubrow+@andrew.cmu.edu (David Zubrow) writes:
>I could not find any mention of a random number generator in the LSC manual.
>Does one exist?  If not, are there any modules out there for implementing
>random numbers?
>zubrow@andrew.cmu.edu

In the math library, you will find the functions rand() and srand()...these are
pretty standard "C" functions.  In the Mac ROMS, there are several Rnadom
number related routines, notably, Random. . . .

Pereant, inquit, qui ante nos nostra dixerunt.
cheeser

-- 
===============================================================================
Jonathan Bing, Master (cheeser)			...ihnp4!hoptoad!dasys1!cheeser
	      Time flys like an Arrow, Fruit Flies like Bananas!
===============================================================================