The and Command

Command Summary

Returns the logical value of value1 and value2 being true.

Command Syntax

value1 and value2

Menu Location


  1. 2nd TEST to access the test menu.
  2. RIGHT to access the LOGIC submenu.
  3. ENTER to select and.

Calculator Compatibility


Token Size

1 byte

and takes two numbers, variables, or expressions and tests to see if they are both True (not equal to 0). If they are, it returns 1. If either input is False (0), it returns 0. Note that the order of the operators doesn't matter (i.e. and is commutative), and that multiple and's can be used together

:0 and 0 

:0 and 1

:1 and 2           (2 counts as True, just like one)

:X and 2+2         (you can use variables and expressions)

:1 and 1 and 2-2   (the last input evaluates to 0, or false)


Multiplying two values has the same truth value as and; thus, and can sometimes be replaced by multiplication. Because the calculator does implicit multiplication, meaning it automatically recognises when you want to multiply, you don't need to use the * sign.

:If A and B
can be
:If AB

However, do not use this optimization if A and B might be expected to take on large values, as an overflow error might occur.

Related Commands


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 License.