unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: percent-change
Date: Sat, 13 May 2023 17:58:48 +0200	[thread overview]
Message-ID: <873540xlxj.fsf@dataswamp.org> (raw)
In-Reply-To: CAP_d_8XQ3p4k=rzJWT8J1+K_DcADorLMyKofBEekkvKyi9M_8w@mail.gmail.com

Yuri Khan wrote:

>> Take a look at this, see examples for intended bahvior.
>> This was more difficult than I imagined, maybe there is
>> some simpler way to do it?
>
>     (defun yk-percent-change (from to)
>       (if (= from to)
>           0
>         (/ (- to from) (abs from) 0.01)))

Digital!

-- 
underground experts united
https://dataswamp.org/~incal




  reply	other threads:[~2023-05-13 15:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 13:35 percent-change Emanuel Berg
2023-05-13 13:37 ` percent-change Ruijie Yu via Users list for the GNU Emacs text editor
2023-05-13 14:00   ` percent-change Emanuel Berg
2023-05-13 14:06   ` percent-change Emanuel Berg
2023-05-13 15:16 ` percent-change Yuri Khan
2023-05-13 15:58   ` Emanuel Berg [this message]
2023-05-13 16:04   ` percent-change Emanuel Berg
2023-05-14 14:29     ` percent-change Yuri Khan
2023-05-15  2:54       ` percent-change Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873540xlxj.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).