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

Adjust sbe genericAbs to return nan when called with a nan operand

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • Fully Compatible
    • ALL
    • QE 2025-03-17
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When we call genericAbs with a NaN operand here, the result is -NaN. This is because NaN is a NumberDouble, when we compare operand >= 0 is true, so we return -operand (-NaN). As a solution, we can adjust the check to also return operand if it is a NaN: operand >= 0 || std::isnan(operand).

            Assignee:
            victorfilip.ghita@mongodb.com Victor Ghita
            Reporter:
            victorfilip.ghita@mongodb.com Victor Ghita
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None