emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calc/calc-comb.el


From: Jay Belanger
Subject: [Emacs-diffs] Changes to emacs/lisp/calc/calc-comb.el
Date: Fri, 17 Dec 2004 00:37:06 -0500

Index: emacs/lisp/calc/calc-comb.el
diff -c emacs/lisp/calc/calc-comb.el:1.9 emacs/lisp/calc/calc-comb.el:1.10
*** emacs/lisp/calc/calc-comb.el:1.9    Thu Dec 16 22:56:08 2004
--- emacs/lisp/calc/calc-comb.el        Fri Dec 17 05:26:18 2004
***************
*** 540,551 ****
  ;;; Produce a random 10-bit integer, with (random) if no seed provided,
  ;;; or else with Numerical Recipes algorithm ran3 / Knuth 3.2.2-A.
  
! (defvar var-RandSeed nil)
  (defvar math-random-cache nil)
  (defvar math-gaussian-cache nil)
  
  (defun math-init-random-base ()
!   (if var-RandSeed
        (if (eq (car-safe var-RandSeed) 'vec)
          nil
        (if (Math-integerp var-RandSeed)
--- 540,551 ----
  ;;; Produce a random 10-bit integer, with (random) if no seed provided,
  ;;; or else with Numerical Recipes algorithm ran3 / Knuth 3.2.2-A.
  
! (defvar var-RandSeed)
  (defvar math-random-cache nil)
  (defvar math-gaussian-cache nil)
  
  (defun math-init-random-base ()
!   (if (and (boundp 'var-RandSeed) var-RandSeed)
        (if (eq (car-safe var-RandSeed) 'vec)
          nil
        (if (Math-integerp var-RandSeed)
***************
*** 599,607 ****
  ;;; Produce a random digit in the range 0..999.
  ;;; Avoid various pitfalls that may lurk in the built-in (random) function!
  ;;; Shuffling algorithm from Numerical Recipes, section 7.1.
  (defun math-random-digit ()
!   (let (i math-random-last)
!     (or (and var-RandSeed (eq var-RandSeed math-last-RandSeed))
        (math-init-random-base))
      (or math-random-cache
        (progn
--- 599,608 ----
  ;;; Produce a random digit in the range 0..999.
  ;;; Avoid various pitfalls that may lurk in the built-in (random) function!
  ;;; Shuffling algorithm from Numerical Recipes, section 7.1.
+ (defvar math-random-last)
  (defun math-random-digit ()
!   (let (i)
!     (or (and (boundp 'var-RandSeed) (eq var-RandSeed math-last-RandSeed))
        (math-init-random-base))
      (or math-random-cache
        (progn




reply via email to

[Prev in Thread] Current Thread [Next in Thread]