Convert Decimal128 math functions to static methods

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Works as Designed
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability
    • QE 2025-05-12
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Some of the Decimal128 math functions are non-commutative and have a possibly confusing interface:

      a.logarithm(b)
      

      This would calculate the logarithm of "a", with base "b". Confusion has led to bugs in the past such as SERVER-91223. A more clear interface would use static methods, like:

      Decimal128::logarithm(a, b)
      

      or even with comments

      Decimal128::logarithm(a /*input*/, b  /*base*/)
      

      This is especially important for non-commutative functions.

              Assignee:
              Unassigned
              Reporter:
              Matt Boros
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: