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 1jKkVg-0007vO-Sv for pgsql-docs@arkaria.postgresql.org; Sat, 04 Apr 2020 15:15:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jKkVe-0003Na-RW for pgsql-docs@arkaria.postgresql.org; Sat, 04 Apr 2020 15:14:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKkVe-0003NT-LY for pgsql-docs@lists.postgresql.org; Sat, 04 Apr 2020 15:14:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKkVY-0006hh-L4 for pgsql-docs@lists.postgresql.org; Sat, 04 Apr 2020 15:14:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 034FEoYN012684; Sat, 4 Apr 2020 11:14:50 -0400 From: Tom Lane To: jon4syth@gmail.com cc: pgsql-docs@lists.postgresql.org Subject: Re: ceil/ceiling/floor mathematical functions documented output is incorrect In-reply-to: <158601208256.26952.12175144547423151566@wrigleys.postgresql.org> References: <158601208256.26952.12175144547423151566@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Sat, 04 Apr 2020 14:54:42 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12682.1586013290.1@sss.pgh.pa.us> Date: Sat, 04 Apr 2020 11:14:50 -0400 Message-ID: <12683.1586013290@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Doc comments form writes: > The ceil, ceiling, and floor mathematical functions in documentation > versions 9.5 through 12, and probably others is not correct. The example > output shows the ceil* functions returning the integer below the float value > while the floor function shows the opposite. Thanks! No, they're correct as they stand. These examples intentionally use negative numbers to make the point that the rounding is towards or away from plus-infinity, not towards or away from zero. If we had room for more than one example, I'd be inclined to make these cases be secondary examples rather than the only one. There's some work afoot to restructure this chapter's function tables in a way that would make that a bit less painful vertical-space-wise, so maybe it'll get done soon. regards, tom lane