Skip to content

Commit 0b8848c

Browse files
committed
Explain how AND and OR work with NaN when variadic arguments
Closes #23
1 parent 4912c7c commit 0b8848c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/manual/functions.qmd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
The following built-in functions are available:
44

5-
::: {}
65
| Function | Description |
76
| :-- | :-- |
87
| ABS(Number) | Absolute value of *Number*. |
@@ -52,7 +51,6 @@ The following built-in functions are available:
5251
| TRUNC(Number) | Discards the fractional part of *Number*.<br>\linebreak `TRUNC(-3.2)` = -3<br>\linebreak `TRUNC(3.2)` = 3 |
5352

5453
Table: Math Functions\index{functions!math}
55-
:::
5654

5755
::: {.warningsection data-latex=""}
5856
`ISNA()` differs from some spreadsheet programs for certain expressions, such as divisions by zero.
@@ -104,7 +102,7 @@ Defining `TE_FLOAT` will disable all bitwise functions and operators.
104102
Table: Statistical Functions\index{functions!statistical}
105103
:::
106104

107-
::: {.minipage data-latex="{\textwidth}"}
105+
:::: {.minipage data-latex="{\textwidth}"}
108106
| Function | Description |
109107
| :-- | :-- |
110108
| AND(Value1, Value2, ...) | Returns true if all conditions are true. |
@@ -114,7 +112,11 @@ Table: Statistical Functions\index{functions!statistical}
114112
| OR(Value1, Value2, ...) | Returns true if any condition is true. |
115113

116114
Table: Logic Functions\index{functions!logical}
115+
116+
::: {.warningsection data-latex=""}
117+
`AND` and `OR` ignore NaN arguments during evaluation, so results may differ from *Excel* when subexpressions resolve to NaN.
117118
:::
119+
::::
118120

119121
::: {.notesection data-latex=""}
120122
The first argument to any logic function must be valid (i.e., not NaN). If the first argument evaluates to NaN, then NaN will be returned.

0 commit comments

Comments
 (0)