Skip to content

Commit

Permalink
[CUBRIDMAN-110] Change the 'Result of NUMERIC Type Operation' simply (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
youngjinj authored Aug 7, 2023
1 parent ad74856 commit 71a74ea
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
24 changes: 12 additions & 12 deletions en/sql/function/arithmetic_op.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@ The following table shows the total number of digits (*p*) and the number of dig

**Result of NUMERIC Type Operation**

+-----------------------+--------------------------------------------------------------------------------------------------------------------------+-------------------+
| Operation | Maximum Precision | Maximum Scale |
+=======================+==========================================================================================================================+===================+
| N(p1, s1) + N(p2, s2) | max(p1-s1, p2-s2)+max(s1, s2) +1 | max(s1, s2) |
+-----------------------+--------------------------------------------------------------------------------------------------------------------------+-------------------+
| N(p1, s1) - N(p2, s2) | max(p1-s1, p2-s2)+max(s1, s2) | max(s1, s2) |
+-----------------------+--------------------------------------------------------------------------------------------------------------------------+-------------------+
| N(p1, s1) * N(p2, s2) | p1+p2+1 | s1+s2 |
+-----------------------+--------------------------------------------------------------------------------------------------------------------------+-------------------+
| N(p1, s1) / N(p2, s2) | Let Pt = p1+max(s1, s2) + s2 - s1 when s2 > 0 and Pt = p1 in other cases; St = s1 when s1 > s2 and s2 in other cases; | |
| | the number of decimal places is min(9-St, 38-Pt) + St when St < 9 and St in other cases. | |
+-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------+---------------------------------------------+------------------------------------------------+
| Operation | Maximum Precision | Maximum Scale |
+=======================+=============================================+================================================+
| N(p1, s1) + N(p2, s2) | max(p1 - s1, p2 - s2) + max(s1, s2) + 1 | max(s1, s2) |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) - N(p2, s2) | max(p1 - s1, p2 - s2) + max(s1, s2) | max(s1, s2) |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) * N(p2, s2) | p1 + p2 + 1 | s1 + s2 |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) / N(p2, s2) | | Pt = (p1 - s1) + s2 + max(9, max(s1, s2)) | | St = max(9, max(s1, s2)) |
| | | Pt = (Pt > 38) ? 38 : Pt | | St = (Pt > 38) ? min(9, St - (Pt - 38)) : St |
+-----------------------+---------------------------------------------+------------------------------------------------+

**Example**

Expand Down
2 changes: 1 addition & 1 deletion ko/api/node_js.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Node.js 설치

**설치**

CUBRID Node.js 드라이버는 먼저 https://nodejs.org/download/에서 node.js를 설치한 후, npm(Node Packaged Modules) install 명령을 사용하여 설치할 수 있다. ::
CUBRID Node.js 드라이버는 먼저 https://nodejs.org/download/\서 node.js를 설치한 후, npm(Node Packaged Modules) install 명령을 사용하여 설치할 수 있다. ::

npm install node-cubrid

Expand Down
24 changes: 12 additions & 12 deletions ko/sql/function/arithmetic_op.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@

**NUMERIC 타입의 연산 결과**

+-----------------------+---------------------------------------------------------------------------------------------+---------------------------+
| 연산 | 결과의 최대 자릿수 | 결과의 소수점 이하 자릿수 |
+=======================+=============================================================================================+===========================+
| N(p1, s1) + N(p2, s2) | max(p1-s1, p2-s2)+max(s1, s2) +1 | max(s1, s2) |
+-----------------------+---------------------------------------------------------------------------------------------+---------------------------+
| N(p1, s1) - N(p2, s2) | max(p1-s1, p2-s2)+max(s1, s2) | max(s1, s2) |
+-----------------------+---------------------------------------------------------------------------------------------+---------------------------+
| N(p1, s1) * N(p2, s2) | p1+p2+1 | s1+s2 |
+-----------------------+---------------------------------------------------------------------------------------------+---------------------------+
| N(p1, s1) / N(p2, s2) | s2 > 0 이면 Pt = p1+max(s1, s2) + s2 - s1, 그 외에는 Pt = p1라 하고, s1 > s2 이면 St = s1, |
| | 그 외에는 s2라 하면, 소수점 이하 자릿수는 St < 9 이면 min(9-St, 38-Pt) + St, 그 외에는 St |
+-----------------------+---------------------------------------------------------------------------------------------+---------------------------+
+-----------------------+---------------------------------------------+------------------------------------------------+
| 연산 | 결과의 최대 자릿수 | 결과의 소수점 이하 자릿수 |
+=======================+=============================================+================================================+
| N(p1, s1) + N(p2, s2) | max(p1 - s1, p2 - s2) + max(s1, s2) + 1 | max(s1, s2) |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) - N(p2, s2) | max(p1 - s1, p2 - s2) + max(s1, s2) | max(s1, s2) |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) * N(p2, s2) | p1 + p2 + 1 | s1 + s2 |
+-----------------------+---------------------------------------------+------------------------------------------------+
| N(p1, s1) / N(p2, s2) | | Pt = (p1 - s1) + s2 + max(9, max(s1, s2)) | | St = max(9, max(s1, s2)) |
| | | Pt = (Pt > 38) ? 38 : Pt | | St = (Pt > 38) ? min(9, St - (Pt - 38)) : St |
+-----------------------+---------------------------------------------+------------------------------------------------+

**예제**

Expand Down

0 comments on commit 71a74ea

Please sign in to comment.