and: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "source>" to "syntaxhighlight>") |
|||
Line 9: | Line 9: | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
and(n1, n2, ...) | and(n1, n2, ...) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
{{param|n1|Number}} | {{param|n1|Number}} | ||
Line 19: | Line 19: | ||
[r: and(1,1)] | [r: and(1,1)] | ||
[r: and(1,1,0)] | [r: and(1,1,0)] | ||
</ | </syntaxhighlight> | ||
'''Returns:''' | '''Returns:''' | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
1 | 1 | ||
0 | 0 | ||
</ | </syntaxhighlight> | ||
|also= | |also= |
Revision as of 17:04, 14 March 2023
and() Function
This function performs a logical AND comparison between all of the passed numeric values. A value of 0 is
false
and all non-zero values are treated as true
Usage
<source lang="mtmacro" line> and(n1, n2, ...) </syntaxhighlight> Parameters
n1
- Numbern2
- Numbern3+
- Number
Example
<source lang="mtmacro" line>
[r: and(1,1)] [r: and(1,1,0)] </syntaxhighlight> Returns: <source lang="mtmacro" line> 1 0
</syntaxhighlight>