Need to specify the behaviour of arithmetic operators on Decimal type

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor
    • V4.0_ERRATA03
    • Affects Version/s: V4.0_OS
    • Component/s: URL Conventions
    • None
    • Environment:

      Applied

    • Hide

      If A and B are values of type decimal, with scales scaleof(A) and scaleof(B), then:

      scaleof(A add B) = max(scaleof(A), scaleof(B))
      scaleof(A sub B) = max(scaleof(A), scaleof(B))
      scaleof(A mul B) = scaleof(A) + scaleof(B)
      scaleof(A mod B) = max(scaleof(A), scaleof(B))
      scaleof(A div B) = computed with max decimal scale; how this is reported is service defined. client can cast to force scale.

      For decimal values with "floating" scale, result is decimal with floating scale.

      Show
      If A and B are values of type decimal, with scales scaleof(A) and scaleof(B), then: scaleof(A add B) = max(scaleof(A), scaleof(B)) scaleof(A sub B) = max(scaleof(A), scaleof(B)) scaleof(A mul B) = scaleof(A) + scaleof(B) scaleof(A mod B) = max(scaleof(A), scaleof(B)) scaleof(A div B) = computed with max decimal scale; how this is reported is service defined. client can cast to force scale. For decimal values with "floating" scale, result is decimal with floating scale.
    • Show
      https://www.oasis-open.org/committees/download.php/57687/odata-v4.0-wd08-part2-url-conventions-2016-03-03.docx

      The rules for scale of results of decimal arithmetic operators are not specified.

            Assignee:
            handl
            Reporter:
            evan.ireland.2
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: