Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbca0f60

Browse files
committed
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 theback 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>
1 parentb5dd25b commitbca0f60

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@
659659
<literal><function>ceil(<type>dp</type> or <type>numeric</type>)</function></literal>
660660
</entry>
661661
<entry>(same as input)</entry>
662-
<entry>smallest integernot lessthan argument</entry>
662+
<entry>nearest integergreaterthan or equal to argument</entry>
663663
<entry><literal>ceil(-42.8)</literal></entry>
664664
<entry><literal>-42</literal></entry>
665665
</row>
@@ -672,7 +672,7 @@
672672
<literal><function>ceiling(<type>dp</type> or <type>numeric</type>)</function></literal>
673673
</entry>
674674
<entry>(same as input)</entry>
675-
<entry>smallest integernot lessthan argument (alias for <function>ceil</function>)</entry>
675+
<entry>nearest integergreaterthanor equal toargument (same as <function>ceil</function>)</entry>
676676
<entry><literal>ceiling(-95.3)</literal></entry>
677677
<entry><literal>-95</literal></entry>
678678
</row>
@@ -725,7 +725,7 @@
725725
<literal><function>floor(<type>dp</type> or <type>numeric</type>)</function></literal>
726726
</entry>
727727
<entry>(same as input)</entry>
728-
<entry>largest integernot greaterthan argument</entry>
728+
<entry>nearest integerlessthan or equal to argument</entry>
729729
<entry><literal>floor(-42.8)</literal></entry>
730730
<entry><literal>-43</literal></entry>
731731
</row>

‎src/include/catalog/pg_proc.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,11 @@ DESCR("round to nearest integer");
396396
DATA(insertOID=229 (dtruncPGNSPPGUID121000fffftfi10701"701"_null__null__null__null_dtrunc_null__null__null_ ));
397397
DESCR("truncate to integer");
398398
DATA(insertOID=2308 (ceilPGNSPPGUID121000fffftfi10701"701"_null__null__null__null_dceil_null__null__null_ ));
399-
DESCR("smallest integer >= value");
399+
DESCR("nearest integer >= value");
400400
DATA(insertOID=2320 (ceilingPGNSPPGUID121000fffftfi10701"701"_null__null__null__null_dceil_null__null__null_ ));
401-
DESCR("smallest integer >= value");
401+
DESCR("nearest integer >= value");
402402
DATA(insertOID=2309 (floorPGNSPPGUID121000fffftfi10701"701"_null__null__null__null_dfloor_null__null__null_ ));
403-
DESCR("largest integer <= value");
403+
DESCR("nearest integer <= value");
404404
DATA(insertOID=2310 (signPGNSPPGUID121000fffftfi10701"701"_null__null__null__null_dsign_null__null__null_ ));
405405
DESCR("sign of value");
406406
DATA(insertOID=230 (dsqrtPGNSPPGUID121000fffftfi10701"701"_null__null__null__null_dsqrt_null__null__null_ ));
@@ -2193,11 +2193,11 @@ DESCR("value truncated to 'scale'");
21932193
DATA(insertOID=1710 (truncPGNSPPGUID141000fffftfi101700"1700"_null__null__null__null_"select pg_catalog.trunc($1,0)"_null__null__null_ ));
21942194
DESCR("value truncated to 'scale' of zero");
21952195
DATA(insertOID=1711 (ceilPGNSPPGUID121000fffftfi101700"1700"_null__null__null__null_numeric_ceil_null__null__null_ ));
2196-
DESCR("smallest integer >= value");
2196+
DESCR("nearest integer >= value");
21972197
DATA(insertOID=2167 (ceilingPGNSPPGUID121000fffftfi101700"1700"_null__null__null__null_numeric_ceil_null__null__null_ ));
2198-
DESCR("smallest integer >= value");
2198+
DESCR("nearest integer >= value");
21992199
DATA(insertOID=1712 (floorPGNSPPGUID121000fffftfi101700"1700"_null__null__null__null_numeric_floor_null__null__null_ ));
2200-
DESCR("largest integer <= value");
2200+
DESCR("nearest integer <= value");
22012201
DATA(insertOID=1718 (numeric_eqPGNSPPGUID121000fffftfi2016"1700 1700"_null__null__null__null_numeric_eq_null__null__null_ ));
22022202
DATA(insertOID=1719 (numeric_nePGNSPPGUID121000fffftfi2016"1700 1700"_null__null__null__null_numeric_ne_null__null__null_ ));
22032203
DATA(insertOID=1720 (numeric_gtPGNSPPGUID121000fffftfi2016"1700 1700"_null__null__null__null_numeric_gt_null__null__null_ ));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp