Don't click here unless you want to be banned.

LSL Wiki : Operators

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org

Operators


In mathematics, an operator is a symbol that expresses the operation to be performed. In LSL, operators perform simple "common-sense" operations on values. The assignment operators are special in that the left hand side of the operation must be a variable.

Operator TypesDescriptionExamples
UnaryOperators that act on one value ++, --, ~, !
BinaryOperators that act on two values. +, -, *, /, %, +=, -=, *=, /=, %=, &&, ||, !, ==, !=, <=, <, >=, >
BooleanOperators that work with TRUE and FALSE values. &&, ||, !, ==, !=, <=, <, >=, >
BitwiseOperators that work with bitfields &, |, ~, ^, <<, >>
AssignmentSpecial operators that assign a value to a variable. =, +=, -=, *=, /=, %=

All operators in order of execution or precedence, from high to low:

Operation Description
() [] . Parentheses, Square Brackets and Dot Operator
! ~ ++ -- NOT, One's Complement, Increment, Decrement
* / % Multiply, Divide, Modulus (% is also Vector Cross)
+ - Addition and Subtraction
<< >> Left Shift, Right Shift
< <= > >= Less Than, Less Than Or Equal To, Greater Than, Greater Than or Equal To
== != Comparison Equal, Comparison Not Equal
& Bitwise AND
^ Bitwise XOR
| Bitwise OR
|| Comparison OR
&& Comparison AND
= += -= *= /= %= Assignment


Math

Operators | Unary | Binary | Bitwise | Boolean | Equality | Assignment
Comments [Hide comments/form]
No offense but it's also pretty pointless. Operator usage is fairly obvious, and the unsupported combinations are so many, that we should probably redo this page in plain text :)
-- EggyLippmann (2004-08-14 18:40:14)
Find an easy method of describing all the combinations and I'll be all for it eggy :)
-- ChristopherOmega (2004-08-15 01:22:57)
Anywho, I added Multiplication...For The Newbs..For The Newbs *wink*
-- MingChen (2004-09-25 21:21:32)
added Devision and corrected Multiplication for vectors & rotations.
-- BlindWanderer (2004-09-25 23:37:48)
Corrected the multiplication table (*), removing an extraneous "Not allowed" column from the vector row. Table cells line up with their proper descriptions now.
-- ChandraPage (2005-02-11 11:04:43)
This is scary there is a "\=" operator and it acts just like "="
... i think
-- BlindWanderer (2005-09-21 16:39:05)
Attach a comment to this page: