A newer version of Max is available. Click here to access the latest version of this document.

&&

If both numbers are non-zero, output a 1

Description

&& takes any given number, compares it to another specified number, and outputs a 1 if the two numbers are both non-zero numbers, or a 0 if either number is 0.

Arguments

Name Type Opt Description
initial-value int opt Sets an initial value to be stored by &&. A number in the right inlet changes the value set by the argument.

Messages

bang In left inlet: Performs the operation with the numbers currently stored. If there is no argument, && initially holds 0.
int input [int]
If the number in both inlets is not 0, then the output is 1. If the number in one or both of the inlets is 0, then the output is 0. A number in the left inlet triggers the output.
  (inlet1) comparison-value [int]
In right inlet: The number is compared to the number in the left inlet to determine output but only a number in the left inlet will trigger output.
float input [float]
Converted to int.
set set-input [int]
The word set followed by a number will set the input value without causing output.

Information for box attributes common to all objects

Output

int: If the number in the left inlet and the number in the right inlet (or specified by the argument) are both not 0, then the output is 1. Otherwise, the output is 0.

Examples

Both numbers are not 0... Used to combine comparisons

See Also

Name Description
& Bitwise intersection of two numbers
| Bitwise union of two numbers
|| If either of two numbers is non-zero, output a 1
Max Basic Tutorial 19: Timing Max Basic Tutorial 19: Timing