From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Making 'eq' == 'eql' in bignum branch Date: Fri, 31 Aug 2018 17:15:30 -0400 Message-ID: References: <0F8F6E54-176C-48EE-9E7C-7CAC424D0D55@raeburn.org> <352c998a64c646b983a131039e9c732b@lanl.gov> <20180831195942.GA4898@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1535750768 8495 195.159.176.226 (31 Aug 2018 21:26:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 31 Aug 2018 21:26:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 31 23:26:04 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvqvb-00025v-Op for ged-emacs-devel@m.gmane.org; Fri, 31 Aug 2018 23:26:03 +0200 Original-Received: from localhost ([::1]:58501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvqxi-0007cn-63 for ged-emacs-devel@m.gmane.org; Fri, 31 Aug 2018 17:28:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvquy-0003jE-4g for emacs-devel@gnu.org; Fri, 31 Aug 2018 17:25:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvqlX-0000IC-Kl for emacs-devel@gnu.org; Fri, 31 Aug 2018 17:15:44 -0400 Original-Received: from [195.159.176.226] (port=34193 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fvqlX-0000HN-Cl for emacs-devel@gnu.org; Fri, 31 Aug 2018 17:15:39 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fvqjO-0003a1-2y for emacs-devel@gnu.org; Fri, 31 Aug 2018 23:13:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:mWW37AKcykkGKlv0MUVtW5QNk9A= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229149 Archived-At: I don't have any opinion on whether infinities should be called numbers or not, but regarding: > There have been discussions about the Lisp functions max and min being > called without arguments. Some people have advocated that non-numbers > be returned in such cases. I request most earnestly that this is not > done. Callers of these functions have a right to assume that returned > results are mathematically correct and that they can do arithmetic with > them. Currently many arithmetic functions, when called with "non-numbers" do not signal an error, but instead return another such "non-number". E.g. (+ 1.0e+INF 1) returns 1.0e+INF. This is considered normal according to the IEEE practice. So, from that point of view, I think it's fairly normal for min/max to follow the same practice and return some kind of non-number when called with another non-number, and by extension when not called with a number. This non-number result (e.g. 1.0e+INF for `min`) can very be considered as "returning an error" (just not using Elisp's error handling system, but using IEEE's NaNs instead). Stefan PS: I prefer to stay away from anything past the Z set of numbers, and I think anything involving floats will inevitably suck in corner cases, so any behavior you choose in that case is OK AFAIC ;-)