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

MongoShell numberDecimalsAlmostEqual(NumberDecimal(0), NumberDecimal(0)) returns false

    • Fully Compatible
    • ALL
    • v6.0
    • QE 2022-08-08, QE 2022-08-22
    • 160

      Shell function `numberDecimalsAlmostEqual` returns false when passing two zeros as an input.

      The reason for that is taking logarithm of the values, which is `NaN` for 0.

      The whole approximated comparison algorithm works under assumption that these values are not zero.

            Assignee:
            denis.grebennicov@mongodb.com Denis Grebennicov
            Reporter:
            denis.grebennicov@mongodb.com Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: