diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-06-09 11:58:00 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-06-09 11:58:00 -0400 |
commit | d9ce54c0b83506473828444c30a96e3e2601fe7d (patch) | |
tree | 59759893e036aadaac195f0677e690aee7a731d2 | |
parent | 81f51b7c3f53340ba59fd818a70007c61d4e3e74 (diff) | |
download | postgresql-d9ce54c0b83506473828444c30a96e3e2601fe7d.tar.gz postgresql-d9ce54c0b83506473828444c30a96e3e2601fe7d.zip |
Clarify documentation of ceil/ceiling/floor functions.
Document these as "nearest integer >= argument" and "nearest integer <=
argument", which will hopefully be less confusing than the old formulation.
New wording is from Matlab via Dean Rasheed.
I changed the pg_description entries as well as the SGML docs. In the
back branches, this will only affect installations initdb'd in the future,
but it should be harmless otherwise.
Discussion: <CAEZATCW3yzJo-NMSiQs5jXNFbTsCEftZS-Og8=FvFdiU+kYuSA@mail.gmail.com>
-rw-r--r-- | doc/src/sgml/func.sgml | 6 | ||||
-rw-r--r-- | src/include/catalog/pg_proc.h | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 38280231999..61942236fa4 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -659,7 +659,7 @@ <literal><function>ceil(<type>dp</type> or <type>numeric</type>)</function></literal> </entry> <entry>(same as input)</entry> - <entry>smallest integer not less than argument</entry> + <entry>nearest integer greater than or equal to argument</entry> <entry><literal>ceil(-42.8)</literal></entry> <entry><literal>-42</literal></entry> </row> @@ -672,7 +672,7 @@ <literal><function>ceiling(<type>dp</type> or <type>numeric</type>)</function></literal> </entry> <entry>(same as input)</entry> - <entry>smallest integer not less than argument (alias for <function>ceil</function>)</entry> + <entry>nearest integer greater than or equal to argument (same as <function>ceil</function>)</entry> <entry><literal>ceiling(-95.3)</literal></entry> <entry><literal>-95</literal></entry> </row> @@ -725,7 +725,7 @@ <literal><function>floor(<type>dp</type> or <type>numeric</type>)</function></literal> </entry> <entry>(same as input)</entry> - <entry>largest integer not greater than argument</entry> + <entry>nearest integer less than or equal to argument</entry> <entry><literal>floor(-42.8)</literal></entry> <entry><literal>-43</literal></entry> </row> diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 1ddce37c541..3e96b0c9638 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -400,11 +400,11 @@ DESCR("round to nearest integer"); DATA(insert OID = 229 ( dtrunc PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dtrunc _null_ _null_ _null_ )); DESCR("truncate to integer"); DATA(insert OID = 2308 ( ceil PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dceil _null_ _null_ _null_ )); -DESCR("smallest integer >= value"); +DESCR("nearest integer >= value"); DATA(insert OID = 2320 ( ceiling PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dceil _null_ _null_ _null_ )); -DESCR("smallest integer >= value"); +DESCR("nearest integer >= value"); DATA(insert OID = 2309 ( floor PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dfloor _null_ _null_ _null_ )); -DESCR("largest integer <= value"); +DESCR("nearest integer <= value"); DATA(insert OID = 2310 ( sign PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dsign _null_ _null_ _null_ )); DESCR("sign of value"); DATA(insert OID = 230 ( dsqrt PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dsqrt _null_ _null_ _null_ )); @@ -2237,11 +2237,11 @@ DESCR("value truncated to 'scale'"); DATA(insert OID = 1710 ( trunc PGNSP PGUID 14 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ "select pg_catalog.trunc($1,0)" _null_ _null_ _null_ )); DESCR("value truncated to 'scale' of zero"); DATA(insert OID = 1711 ( ceil PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_ceil _null_ _null_ _null_ )); -DESCR("smallest integer >= value"); +DESCR("nearest integer >= value"); DATA(insert OID = 2167 ( ceiling PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_ceil _null_ _null_ _null_ )); -DESCR("smallest integer >= value"); +DESCR("nearest integer >= value"); DATA(insert OID = 1712 ( floor PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_floor _null_ _null_ _null_ )); -DESCR("largest integer <= value"); +DESCR("nearest integer <= value"); DATA(insert OID = 1718 ( numeric_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1700 1700" _null_ _null_ _null_ _null_ numeric_eq _null_ _null_ _null_ )); DATA(insert OID = 1719 ( numeric_ne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1700 1700" _null_ _null_ _null_ _null_ numeric_ne _null_ _null_ _null_ )); DATA(insert OID = 1720 ( numeric_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1700 1700" _null_ _null_ _null_ _null_ numeric_gt _null_ _null_ _null_ )); |