help-gnu-emacs
[Top][All Lists]
Advanced

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

Elisp function that performs numeric computations


From: fatiparty
Subject: Elisp function that performs numeric computations
Date: Wed, 19 Jan 2022 10:03:28 +0100 (CET)

Jan 19, 2022, 19:20 by help-gnu-emacs@gnu.org:

>
> I would like to construct an elisp function that performs numeric 
> computations and outputs the result.
>
> j = rptdepth
> w = maxdepth - j
> p = w + 1
>
> output = j + ( (depth - maxdepth - 1) mod p )
>
I have done as follows.  But one problem is: How do I use the output in another 
elisp function?

(defun test (depth maxdepth rptdepth)
  "Compute depth to use."
  (interactive)
  
  (let* ( (j rptdepth)
          (w (- maxdepth j))
          (p (+ w 1))
          (r (mod (- depth maxdepth 1) p) )
          (o (+ j r)) )

    (message "usedepth: %d" o) ))




reply via email to

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