MacTrove  — Classic Macintosh Archive
 
 Home Software Hardware Docs Magazines Forums Search
Search:   Software, forums, magazines & more

Random Number Lib

File random-number-lib.hqx
Size 16.7 KB
Category Development
Architecture PowerPC
↓ Download random-number-lib.hqx

Enjoying MacTrove? Anonymous downloads are free and unlimited. Create a free account to track favorites, contribute corrections, and join the community chat.

About

UltraLibU -- A pseudo-random-number library for Macintosh platforms This library is a new C/Assembly implementation of the Ultra PRNG developed by Marsaglia, et al. (see leading reference in source). It is designed primarily for Macintosh platforms and replaces an earlier (non-PPC) library, by this author, that is currently available in a number of public archives. UltraLibU contains one low-level assembly routine, in a conditional-compilation block, for MC68020 (and higher) or PowerPC processors. (Note: Pure C source for this routine is already available in the usual Internet archives.) The assembly syntax is that of Metrowerks' CodeWarrior but adaptation to other compilers should be trivial. The library contains 14 functions returning random numbers in various formats, from Booleans to Gaussians, as well as ancillary functions to initialize the PRNG and to save/restore its context (to reproduce a sequence exactly). This PRNG is HIGHLY RANDOM, even at the bit level, VERY FAST and has an extremely long period (> 10^356).

MacTrove — Classic Macintosh Archive — Full site | Software | Search
Classic version — compatible with older browsers.