Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJKUr-0004zn-5x for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jun 2017 14:02:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJKUq-0007l8-It for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jun 2017 14:02:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dJKUq-0007kz-9o for pgsql-bugs@postgresql.org; Fri, 09 Jun 2017 14:02:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dJKUj-000244-0m for pgsql-bugs@postgresql.org; Fri, 09 Jun 2017 14:02:39 +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 v59E1KpE025150; Fri, 9 Jun 2017 10:01:21 -0400 From: Tom Lane To: yarex@pobox.sk cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14695: Documentation is not accurate In-reply-to: <20170609065706.26503.29688@wrigleys.postgresql.org> References: <20170609065706.26503.29688@wrigleys.postgresql.org> Comments: In-reply-to yarex@pobox.sk message dated "Fri, 09 Jun 2017 06:57:06 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25148.1497016880.1@sss.pgh.pa.us> Date: Fri, 09 Jun 2017 10:01:20 -0400 Message-ID: <25149.1497016880@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org yarex@pobox.sk writes: > url: https://www.postgresql.org/docs/8.1/static/functions-math.html > CEIL and FLOOR example is not accurate. > ceil(dp or numeric) > smallest integer not less than argument: ceil(-42.8) = -42 That example is just fine: it describes both the actual behavior of the software, and the desired behavior. ceil() is effectively "round towards plus infinity". You seem to be expecting "round away from zero", but that's not how it's defined. For comparison, the Linux man page for the C ceil() function says For example, ceil(0.5) is 1.0, and ceil(-0.5) is 0.0. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs