Subject: bug#75105: (cl-random -1.0e+INF)

From: Pip Cet <[email-masked]>
Date: Mon, 17 Feb 2025 22:24:22 +0000

"Stefan Kangas" <[email-masked]> writes:

> Mattias Engdegård <[email-masked]> writes:
>
>> 16 feb. 2025 kl. 01.50 skrev Pip Cet <[email-masked]>:
>>
>>> (cl-random 0.0) returns 0.0, but one could argue it should throw
>>
>> It definitely should throw, but perhaps it's not worth the incompatibility? Not sure, because existing code that passes 0.0 is likely buggy anyway.
>> Or we could say that it's just an ad-hoc extension, by vague analogy of (car nil) = nil.
>
> FWIW, I'd lean towards fixing it, in the hope that very few packages out
> there will rely on this wrong behavior.

Just to clarify, you think (cl-random 0.0) returning 0.0 is wrong
behavior?  If so, everyone agrees we should make it throw, if for
different reasons (I think the 0.0 return value is mathematically
correct but not important enough for us to deviate from the standard, so
I changed my mind after reading that).

Pip