Skip to content

Commit

Permalink
DOCSP-27221 $atan2 NaN/null fix (#2443) (#2449)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethdyer committed Jan 26, 2023
1 parent 9c054b0 commit 273134d
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions source/reference/operator/aggregation/atan2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ Behavior
``null`` and ``NaN``
~~~~~~~~~~~~~~~~~~~~

If the first argument to :expression:`$atan2` is ``null``,
:expression:`$atan2` returns ``null``. If the first argument to
:expression:`$atan2` is ``NaN``, :expression:`$atan2` returns ``NaN``.
If the first argument resolves to a number *and* the
second argument resolves to either ``NaN`` or ``null``,
:expression:`$atan2` returns the ``NaN`` or ``null`` respectively.
If either argument given to ``$atan2`` is ``null``, the expression returns
``null``. If either argument is ``NaN``, the expression returns ``NaN``.
If one argument is ``null`` and the other is ``NaN``, the expression returns
``null``.


.. list-table::
Expand All @@ -61,21 +59,24 @@ second argument resolves to either ``NaN`` or ``null``,
- Results

* - ``{ $atan2: [ NaN, <value> ] }``
- ``NaN``

*or*

``{ $atan2: [ <value>, NaN ] }``

* - ``{ $atan2: [ <value>, NaN ] }``
- ``NaN``

* - ``{ $atan2: [ null, <value> ] }``

*or*
- ``null``

``{ $atan2: [ <value>, null ] }``
* - ``{ $atan2: [ <value>, null ] }``
- ``null``

* - ``{ $atan2: [ NaN, null ] }``
- ``null``

* - ``{ $atan2: [ null, NaN ] }``
- ``null``


Example
-------

Expand Down

0 comments on commit 273134d

Please sign in to comment.