## Tests and Boolean Logic

by derek

Boolean Logic, no it's not the name of the local bowling alley, it's a fundamental principal behind how programs work. Sort of a true/false test for programs that compared numbers and values. Unless you plan on using boolean logic or programming, you probably won't use anything in the TEST menu - unless you put the words 'and', 'or', 'not' in your text.

#### Tests

2nd [TEST]

There are two parts to the test menu: tests and logic. Tests are the comparison signs: equal, not equal, greater than, greater than/equal to, less than, less than/equal to. Logic has statements for use with boolean logic: and, or, xor, not. Both of these play an important role in boolean logic, though, like any other functions on the calculator, they can be used in plain text. The comparison signs can also be used to define a piece-wise function to graph.

#### Boolean Logic

It's really a true/false thing. You take any 2 values, either variables or numbers, and compare them with a comparison sign. The statement returns a 1 if true and a 0 if false. Usually this will prompt a conditional statement to preform another operation. You can put one in an expression, but I don't know why you'd want to. The logic statement would only be a 1 or 0 in the expression.

5 + (3>2)         6

Since 3 is greater than 2, a value of 1 is returned and added to 5 equals 6. Usually boolean statements are found in programs with conditional statements.

If (X>3)
Then...

By using logic statement, you can combine 2 boolean statements:

(5>X and Y=)3
7<(A or BOB>30)

There are four logic statements: and, or, xor, not
and: if both boolean statement are true, then returns true
or: if either statement is true, then return true
xor: if only one statement is false, then return true
not: if both statements are false, then return true

Well, you probably won't use boolean logic on your calculator, but understanding it can help you on Internet search engines. See, you learned something useful!

enough logic, teach me something else!