Re: BUG #14695: Documentation is not accurate

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: yarex(at)pobox(dot)sk
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14695: Documentation is not accurate
Date: 2017-06-09 14:01:20
Message-ID: 25149.1497016880@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

yarex(at)pobox(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2017-06-09 15:02:37 Re: BUG #14695: Documentation is not accurate
Previous Message Cocco Gianfranco 2017-06-09 13:55:04 Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64