From the course: Grasshopper and Rhino: C# Scripting

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Logical operators

Logical operators

From the course: Grasshopper and Rhino: C# Scripting

Start my 1-month free trial

Logical operators

- [Instructor] Earlier, we learned how to compare two values But what if we wanted to compare Booleans to determine the state of different conditions. To do that, we can use logical operators AND, and OR, which allows us to compare two Boolean values. Let's start with having a look at what the AND operator is. AND operators are useful if we want to check if two Boolean operations or Booleans are true. Say, for example, we had two operations, two is greater than one, and one is less than five. As we have learned, both of these operations will equal to true. If we compare these two operations, we're essentially comparing true AND true as both operations equal to true. Therefore, the result will be true, as when comparing two Booleans with the AND operator, two trues will result in a true. However, if one of the operations became false, for example, one is greater than five, and the Boolean expression changes to true AND false,…

Contents