From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: percent-change
Date: Mon, 15 May 2023 04:54:11 +0200 [thread overview]
Message-ID: <87fs7y719o.fsf@dataswamp.org> (raw)
In-Reply-To: CAP_d_8Wy=Z9Hd61yHqy8b0M44OxNLeWVsqdzbJd+h66B8BXBqw@mail.gmail.com
Yuri Khan wrote:
>> But how/why does that work if 'from' is 0?
>>
>> (/ 1 0 0.01) ; 1.0e+INF
>>
>> What does that mean?
>
> In floating point, dividing by zero is allowed and yields
> +infinity, -infinity or (quiet) not-a-number depending on
> the sign of the numerator. ‘/’ knows to perform the division
> in floating when at least one operand is a float, which 0.01
> nicely provides. 1.0e+INF is just the printed representation
> for positive infinity.
A quiet NaN is not signalled. [1]
(/ 1 0.0) ; 1.0e+INF
(/ 0 0.0) ; -0.0e+NaN
(/ -1 0.0) ; -1.0e+INF
Yes, it is as you say, but why?
Maybe the answer is TLDR:
https://en.wikipedia.org/wiki/Division_by_zero
[1] https://stackoverflow.com/questions/18118408/what-is-the-difference-between-quiet-nan-and-signaling-nan
--
underground experts united
https://dataswamp.org/~incal
prev parent reply other threads:[~2023-05-15 2:54 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 ` percent-change Emanuel Berg
2023-05-13 16:04 ` percent-change Emanuel Berg
2023-05-14 14:29 ` percent-change Yuri Khan
2023-05-15 2:54 ` Emanuel Berg [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fs7y719o.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.