About: Logical operator   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

A logical operator manipulates boolean values (values that can be truth or falsehood). Since NWScript does not have a boolean data type, the values are actually integers, interpreted as boolean values (zero is considered falsehood, while non-zero is considered truth), with the special constants TRUE and FALSE representing canonical values for truth and falsehood. The logical operators in NWScript are &&, ||, and !. These are most often seen in conditionals but are also used when assigning or returning a (logically) boolean value.

AttributesValues
rdfs:label
  • Logical operator
rdfs:comment
  • A logical operator manipulates boolean values (values that can be truth or falsehood). Since NWScript does not have a boolean data type, the values are actually integers, interpreted as boolean values (zero is considered falsehood, while non-zero is considered truth), with the special constants TRUE and FALSE representing canonical values for truth and falsehood. The logical operators in NWScript are &&, ||, and !. These are most often seen in conditionals but are also used when assigning or returning a (logically) boolean value.
dcterms:subject
abstract
  • A logical operator manipulates boolean values (values that can be truth or falsehood). Since NWScript does not have a boolean data type, the values are actually integers, interpreted as boolean values (zero is considered falsehood, while non-zero is considered truth), with the special constants TRUE and FALSE representing canonical values for truth and falsehood. The logical operators in NWScript are &&, ||, and !. These are most often seen in conditionals but are also used when assigning or returning a (logically) boolean value. The logical-and operator (&&) compares the values of two integers and produces TRUE if neither is zero, FALSE otherwise. That is, this operator produces a true value if the expression on its left and the one on its right are true. The logical-or operator (||) compares the values of two integers and produces FALSE if neither is non-zero, TRUE otherwise. That is, this operator produces a true value if the expression on its left or the one on its right is true. The logical-not operator (!) toggles the interpretation of a single integer, turning truth to FALSE and falsehood to TRUE. That is, this operator produces a boolean value that is not the boolean value of the expression on its right. The doubled character in the "and" and "or" operators is important, as the single-character version is a bitwise operator. If a bitwise operator is used in place of a logical-and or logical-or, then scripts tend to function as intended only when the just the values TRUE and FALSE are involved. Even in that case, using a bitwise operator makes the script less robust, as someone might change it later, introducing the possibility of a value other than TRUE or FALSE being involved.
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software