Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CUBRIDMAN-110] Change the 'Result of NUMERIC Type Operation' simply #416

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

youngjinj
Copy link
Contributor

http://jira.cubrid.org/browse/CUBRIDMAN-110
http://jira.cubrid.org/browse/CBRD-24815

Change the contents of 'N(P1, S1) / N(P2, S2)' as below.

  • The content is the same, but change the description to a formula.

    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))
    Pt = (Pt > 38) ? 38 : Pt
    St = max(9, max(s1, s2))
    St = (Pt > 38) ? min(9, St - (Pt - 38)) : St

    https://www.cubrid.org/manual/en/11.2/sql/function/arithmetic_op.html#numeric-data-type-op-and-conversion

@ssihil ssihil requested a review from sjkimxxx July 13, 2023 04:45
@youngjinj youngjinj merged commit c8b373a into CUBRID:develop Jul 31, 2023
2 checks passed
youngjinj added a commit to youngjinj/cubrid-manual that referenced this pull request Aug 4, 2023
http://jira.cubrid.org/browse/CUBRIDMAN-110
http://jira.cubrid.org/browse/CBRD-24815

Change the contents of 'N(P1, S1) / N(P2, S2)' as below.
- The content is the same, but change the description to a formula.
   | 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))<br /> Pt = (Pt > 38) ? 38 : Pt | St = max(9, max(s1, s2))<br /> St = (Pt > 38) ? min(9, St - (Pt - 38)) : St |

   https://www.cubrid.org/manual/en/11.2/sql/function/arithmetic_op.html#numeric-data-type-op-and-conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants