[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: percent-change
From: |
Emanuel Berg |
Subject: |
Re: percent-change |
Date: |
Mon, 15 May 2023 04:54:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
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