Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-91935

Convert Decimal128 math functions to static methods

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution

      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 Unassigned
            Reporter:
            matt.boros@mongodb.com Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: