pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: jon4syth@gmail.com
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: ceil/ceiling/floor mathematical functions documented output is incorrect
Date: Sat, 04 Apr 2020 11:14:50 -0400
Message-ID: <12683.1586013290@sss.pgh.pa.us> (raw)
In-Reply-To: <158601208256.26952.12175144547423151566@wrigleys.postgresql.org>
References: <158601208256.26952.12175144547423151566@wrigleys.postgresql.org>

PG Doc comments form <noreply@postgresql.org> 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





view thread (2+ messages)

Message-ID: <12683.1586013290@sss.pgh.pa.us>
Permalink:  ../12683.1586013290@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12683.1586013290@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 using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jon4syth@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: ceil/ceiling/floor mathematical functions documented output is incorrect
  In-Reply-To: <12683.1586013290@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