pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: yarex@pobox.sk
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14695: Documentation is not accurate
Date: Fri, 09 Jun 2017 10:01:20 -0400
Message-ID: <25149.1497016880@sss.pgh.pa.us> (raw)
In-Reply-To: <20170609065706.26503.29688@wrigleys.postgresql.org>
References: <20170609065706.26503.29688@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (5+ messages)  latest in thread

Message-ID: <25149.1497016880@sss.pgh.pa.us>
Permalink:  ../25149.1497016880@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25149.1497016880@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, yarex@pobox.sk
  Subject: Re: BUG #14695: Documentation is not accurate
  In-Reply-To: <25149.1497016880@sss.pgh.pa.us>
  References: <20170609065706.26503.29688@wrigleys.postgresql.org> <25149.1497016880@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox