Re: Anyone need a random number generator?
Mike Schwab <[email protected]>
| Newsgroups | gmane.comp.emulators.turnkey-mvs |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Apr 28, 2010 at 3:03 PM, Ron Hudson <[email protected]> wrote: > > On Wed, Apr 28, 2010 at 12:39 PM, Rick Fochtman <[email protected]> wrote: <<deleted>> >> //FORT.SYSIN DD * >> C RANDOM NUMBER GENERATOR >> FUNCTION IRND(ISEED) >> IY = IABS(MOD(1103515245 * ISEED + 12345,2**15)) >> IRND = IY >> RETURN >> END <<deleted>> >> >> (Given the math I see there, you might experience integer overflow conditions in the first argument to the MOD function.) > > What can I do? I guess I need to user a 'larger' integer - What is a good reference (there is a short overview > on Jay Moseley's site but no detail like how to specify more bits... > The assembler equivalent should run (i.e. not overflow the registers), not sure about how this particular compiler creates the machine instructions. You will need to test by calling the routine and logging the results. <deleted> -- Mike A Schwab, Springfield IL USA Where do Forest Rangers go to get away from it all?