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

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

    XMLWordPrintableJSON

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: