From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Making 'eq' == 'eql' in bignum branch Date: Thu, 30 Aug 2018 17:14:25 -0400 Message-ID: <03ebbc30-a127-6a57-2ae4-56763286cd0d@gmail.com> References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> <87lgaio7xd.fsf@tromey.com> <877em1cb0i.fsf@tromey.com> <765767b2-d2e5-a9a6-f724-d58ecf4847bb@cs.ucla.edu> <76081b5d-8c10-0a37-2c97-d4864c0faa80@cs.ucla.edu> <09153aed-361d-4f82-d9ac-b502314769ae@cs.ucla.edu> <83lg91dqd4.fsf@gnu.org> <8836uvis5y.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1535663550 27038 195.159.176.226 (30 Aug 2018 21:12:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 30 Aug 2018 21:12:30 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 Cc: emacs-devel@gnu.org To: =?UTF-8?Q?Johan_Bockg=c3=a5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 30 23:12:26 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 1fvUEr-0006uZ-Dz for ged-emacs-devel@m.gmane.org; Thu, 30 Aug 2018 23:12:25 +0200 Original-Received: from localhost ([::1]:50899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvUGx-0003Y8-NJ for ged-emacs-devel@m.gmane.org; Thu, 30 Aug 2018 17:14:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvUGr-0003Y3-Ne for emacs-devel@gnu.org; Thu, 30 Aug 2018 17:14:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvUGr-0001pq-2n for emacs-devel@gnu.org; Thu, 30 Aug 2018 17:14:29 -0400 Original-Received: from mail-yw1-xc30.google.com ([2607:f8b0:4864:20::c30]:33985) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fvUGq-0001pi-Qw; Thu, 30 Aug 2018 17:14:28 -0400 Original-Received: by mail-yw1-xc30.google.com with SMTP id y134-v6so4329482ywg.1; Thu, 30 Aug 2018 14:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7pe/zHWMi3FI65fD7bxb3t/nHU04os50/Xu8c55m7RA=; b=X3nBd6zBJ27dQbF0eUIBEHHd4m86b/XahTsckgCsbJHa+dSEbbKtxf2H6pEuVLQOUF th8GJ1T7V3AuP6QXeP7jHS3r4LcGMoEa1Bef0UdZSV+a1sPxxY3aQJjWEcWZQoDZghrO /9ra3DcCZkfT5RV7HodotVB7DKe/fC0mbut+frQsSTommOR5K3PqWc1ZX8j2E0lltazk UvnZNl/uKsUYGZkK3Ui9pd556oe5OVH9gHw4K/EpoQC1/P8AyY0qkQ6yCkD/bsuctdgM kLO6cGKVgv/6eralWOpmdeVR4rcAO9A/74xaDhuL6QuBkSMahuzsKs9THh39LGEKZMwa uCnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7pe/zHWMi3FI65fD7bxb3t/nHU04os50/Xu8c55m7RA=; b=VhnNHJ9f7WV/jxKlwtHxfrrzcdeBdAV1AUV/+NL3sRP+ajJkWEdTbCkpFKfeCzBUr1 fE8Eg4jW6Gmw6Zq8sRATKi8Oz7PctR3ahNPT+PjTEvakdiSXSwGr5TUi9DdDhtCVFwRk VY2uHwA22KrZHUZiA4xBcOMiVqwY8Ol4HTND1cblxDAQnf/ceXqUpBvcqGSAwOo7sPkz 89ZuBNWmzWA1FXONCvv48LbDG62IfEAj9u33egUTOTjCli6HsQIhl0gFQ4I3ANOHYN2R LJoNl9E7IfoQNuPBgeCHmfv8rRcIKMFAuDBYFW9oCRbmh71GkI9fWme++3UnNyjMtgHN 1QFQ== X-Gm-Message-State: APzg51ATLD99GkEOoI8xSUlyKMR0FYC4Vsjak2S3Ern3XYRxHT4+iKbT C3ABb71sO+unKWXbD6IR34ihVoR2 X-Google-Smtp-Source: ANB0VdYou8muaPj6IyHWJx8taizr3ogCwSwYe3IHMHyGrVG1rlU5KDUFUteuDnxKropQLO8S6frfcg== X-Received: by 2002:a81:288d:: with SMTP id o135-v6mr7056902ywo.171.1535663667641; Thu, 30 Aug 2018 14:14:27 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:5426:d330:7055:3134? ([2601:184:4180:66e7:5426:d330:7055:3134]) by smtp.gmail.com with ESMTPSA id d21-v6sm5790351ywb.16.2018.08.30.14.14.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 14:14:26 -0700 (PDT) In-Reply-To: <8836uvis5y.fsf@gnu.org> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c30 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:229118 Archived-At: On 2018-08-30 15:13, Johan Bockgård wrote: > Clément Pit-Claudel writes: > >> On 2018-08-26 16:45, Richard Stallman wrote: >>> How about if we make min and max accept, and ignore, nil as argument? >> >> I usually use 1.0e+INF and -1.0e+INF when I need a neutral element for >> min and max respectively, rather than most-positive-fixnum. Is there >> anything wrong with that? If not, I think we don't even need to change >> min and max at all. > > It doesn't preserve integerness; (min 1 NEUTRAL-ELEMENT) should be 1, > but (min 1 1e+INF) is 1.0. What platform are you on? On my machine (x86_64-pc-linux-gnu) it returns 1, not 1.0. And, AFAICT, the implementation always returns one of its arguments: static Lisp_Object minmax_driver (ptrdiff_t nargs, Lisp_Object *args, enum Arith_Comparison comparison) { Lisp_Object accum = args[0]; CHECK_NUMBER_COERCE_MARKER (accum); for (ptrdiff_t argnum = 1; argnum < nargs; argnum++) { Lisp_Object val = args[argnum]; CHECK_NUMBER_COERCE_MARKER (val); if (!NILP (arithcompare (val, accum, comparison))) accum = val; else if (FLOATP (val) && isnan (XFLOAT_DATA (val))) return val; } return accum; } Clément.