Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-784

Need to specify the behaviour of arithmetic operators on Decimal type

    XMLWordPrintable

    Details

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

      Applied

    • Proposal:
      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.
    • Resolution:
      Show
      https://www.oasis-open.org/committees/download.php/57687/odata-v4.0-wd08-part2-url-conventions-2016-03-03.docx

      Description

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

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              evan.ireland.2 Evan Ireland
            • Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: