From 573d09bfa3b472e31795add03ae6a58c7ad347d1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 16 Oct 2022 23:37:07 -0700 Subject: [PATCH 04/10] =?UTF-8?q?Simplify=20calc-prog=20by=20using=20?= =?UTF-8?q?=E2=80=98random=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/calc/calc-prog.el (calc-user-define-formula): Simplify by using (random N). --- lisp/calc/calc-prog.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 127f6340a1..0409ef8027 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -200,7 +200,7 @@ calc-user-define-formula (format "%03d" key))) odef (assq key (calc-user-key-map))) (unless keyname - (setq keyname (format "%05d" (abs (% (random) 10000))))) + (setq keyname (format "%05d" (random 10000)))) (while (progn (setq cmd-base-default (concat "User-" keyname)) @@ -268,7 +268,7 @@ calc-user-define-formula (setq func (intern (concat "calcFunc-User" (or keyname (and cmd (symbol-name cmd)) - (format "%05d" (% (random) 10000))))))) + (format "%05d" (random 10000))))))) (if is-lambda (setq calc-user-formula-alist math-arglist) -- 2.34.1