From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#75105: (cl-random -1.0e+INF) Date: Wed, 25 Dec 2024 23:27:09 +0000 Message-ID: <87seqb73aa.fsf@protonmail.com> Reply-To: Pip Cet Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28096"; mail-complaints-to="usenet@ciao.gmane.io" To: 75105@debbugs.gnu.org, mattiasengdegard@gmail.com, monnier@iro.umontreal.ca Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 26 00:28:28 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tQank-00077J-Fe for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Dec 2024 00:28:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQanM-0006i6-Gf; Wed, 25 Dec 2024 18:28:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQanK-0006hw-PW for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 18:28:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQanK-0002d3-Gy for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 18:28:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:From:Date:To:Subject; bh=RO98GxvQonDRL3UTmwq1t6Owo49fSGVRYN/hX+46xWY=; b=v5z6Y0d2Yi2JZ7FI5Lwu3pru6BJrNy/3BvEUDTyP+etl06o8cLtK8Gp7HQ6Gn8d+iVbGC2q0TFMQv5ZQ5LvSJxDA01nkT58Y+oWZuyKlKyzYfBXf5W+yZ0o4EjGJoxN5gfBRqOyHQww3Z6yvgyiGHuxMor6dvpRSB8LtSpOvkdR/cO4SJO/bnuWJUfsH0CQ6rLw9E6p9eLe+wxnd9bsajILZBjzdHHSvPlD/DLDCJOyP6cd5srdx1eP02ql0hLxqkkukiWralkOXEb48YhyqgSDj3AG2qQwiP/ys79hzsaEP57xg/cbZl8noLIHdL1f3jafuqUutvlyKapgjjgh1Ag==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQanK-0007bM-CQ for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 18:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Dec 2024 23:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75105 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.173516924429137 (code B ref -1); Wed, 25 Dec 2024 23:28:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Dec 2024 23:27:24 +0000 Original-Received: from localhost ([127.0.0.1]:39353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQami-0007Zs-2V for submit@debbugs.gnu.org; Wed, 25 Dec 2024 18:27:24 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:34934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQamg-0007Zk-7r for submit@debbugs.gnu.org; Wed, 25 Dec 2024 18:27:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQamf-0006gA-MY for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 18:27:22 -0500 Original-Received: from mail-40133.protonmail.ch ([185.70.40.133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQame-0002JT-2k for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 18:27:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1735169236; x=1735428436; bh=RO98GxvQonDRL3UTmwq1t6Owo49fSGVRYN/hX+46xWY=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector: List-Unsubscribe:List-Unsubscribe-Post; b=CN2gTq5yo5f9jaTillpN1ZmLzqV2IKKyU9omIOtS7jaYbw5KE1pSPq9nEpSI9rZzw Y/IWnB6ouq1qDnbBmijSA85r4UoFmoVW6yzmslSWqGbUh5UQuZiVCeRXJAL2YrRe8w eFMo6eRQ4+n1P9mxhohsf1R8Giwff5OotG+Yank0f8M0uQrAd9+WtyjANYZkzMxnvD Gf895alD6cSBjkUfVHRr3A/CwaORGBKo3MUO6VIi+0W2pu5bOq/IVxlo7kVETO5FHm kYFFKCQdzsRw3x9bU7kvnOkKMX7doT4AQ2Ke05Y353dFL3lDA5lFl0js1u9CHpAF9g 3m80vXNteT+tQ== Feedback-ID: 112775352:user:proton X-Pm-Message-ID: bd07054c7c81eab97a4d3ebde771849147a8b2de Received-SPF: pass client-ip=185.70.40.133; envelope-from=pipcet@protonmail.com; helo=mail-40133.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297742 Archived-At: The current behavior of (cl-random -1.0e+INF) is to return NaN with a probability of 1.1920928955078125e-07, and -1.0e+INF in the remaining cases. There are at least two reasonable things cl-random can return for a negative argument. cl-random implements both, returning a float with negative sign or a nonnegative integer. There are at least two reasonable things cl-random can do in response to a zero argument. cl-random implements three of them: (cl-random 0.0) is 0.0 (cl-random -0.0) is -0.0 (cl-random 0) throws an error While "(while (not (isnan (cl-random -1.0e+INF))))" is an interesting benchmark, its behavior may be somewhat surprising. As this behavior has been in place since at least 1993 (when the function was called random*), users may rely on it, and only the docstring should be changed.