Difference between revisions of "Or"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>or</c> is a keyword for logical binary operator of disjunction (or) of [https://en.wikipedia.org/wiki/Boolean_algebra boolean algebra]. It evaluates...")
(No difference)

Revision as of 19:19, 29 January 2025

or is a keyword for logical binary operator of disjunction (or) of boolean algebra. It evaluates two operands and returns true when at least one of the operands is true, else it returns false.

Examples

print false or false // output : 0
print false or true  // output : 1
print true or false  // output : 1
print true or true   // output : 1

a = false
b = true
c = false
print a or b // output : 1
print b or c // output : 1
print a or c // output : 0

minimum = 3
maximum = 7
A = 4
B = 9
print A > minimum or B < maximum // output : 1
print A < minimum or B < maximum // output : 0