Lee-Mac的函数:
http://www.lee-mac.com/random.html
- ;; Rand - Lee Mac
- ;; PRNG implementing a linear congruential generator with
- ;; parameters derived from the book 'Numerical Recipes'
- (defun LM:rand ( / a c m )
- (setq m 4294967296.0
- a 1664525.0
- c 1013904223.0
- $xn (rem (+ c (* a (cond ($xn) ((getvar 'date))))) m)
- )
- (/ $xn m)
- )
|