Next: Shift Register Pseudorandom
Up: 6: Generation of
Previous: Congruential Random Numbers
- In my group, we have used in the past
- with C code which is essentially
- newran = [a * oldran + c]& MASK,
- where MASK has lower 31 bits = 1. All higher bits = 0.
- We get a floating point number between 0 and 1 by:
floatran = newran/2147483648.0
- This is very simple to code, especially in C which allows you to
use machine capabilities effectively.
Geoffrey Fox, Northeast Parallel Architectures Center at Syracuse University, gcf@npac.syr.edu