Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pkAsR-00088F-Sm for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Apr 2023 21:41:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pkAsQ-0006yS-N6 for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Apr 2023 21:41:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pkAsQ-0006yJ-Ek for pgsql-bugs@lists.postgresql.org; Wed, 05 Apr 2023 21:41:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pkAsN-0017sQ-Rd for pgsql-bugs@lists.postgresql.org; Wed, 05 Apr 2023 21:41:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 335Lf6QB2173638; Wed, 5 Apr 2023 17:41:06 -0400 From: Tom Lane To: Mats Kindahl cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17876: Function width_bucket() for float8 input returns value out of range In-reply-to: References: <17876-61f280d1601f978d@postgresql.org> <3807420.1680093217@sss.pgh.pa.us> <186575.1680190503@sss.pgh.pa.us> <391415.1680268470@sss.pgh.pa.us> Comments: In-reply-to Mats Kindahl message dated "Wed, 05 Apr 2023 09:58:27 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2173636.1680730866.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 05 Apr 2023 17:41:06 -0400 Message-ID: <2173637.1680730866@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mats Kindahl writes: > On Fri, Mar 31, 2023 at 3:14 PM Tom Lane wrote: >> While I'm not bothered too much if rounding affects which internal >> bucket a value lands in, it's a bit more annoying if that causes >> it to be reported as being in the end bucket, when we know positively >> that the value is less than bound2. Is it worth expending more >> cycles to prevent this? > I think it could be. I agree that it does not make sense to select the end > bucket when the value is in range, even if just. Yeah. I did that already at a2a0c7c29, sorry for not circling back to this thread. regards, tom lane