LSL Addition
Revision as of 14:50, 24 January 2010 by Strife Onizuka (talk | contribs)
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Integer
- Operation: Addition
- Example:
- 1 + 1
- Result = 2
- Example:
- See Note1
Float
- Operation: Addition
- Example:
- 1.5 + 1.5
- Result = 3.0
- Example:
- See Note1
Vector
- Operation: Addition
- Example:
- <1.0, 1.0, 1.0> + <1.0, 0.0, -1.0>
- Result = <2.0, 1.0, 0.0>
- Example:
Rotation
- Operation: unknown!
- See Note2
String
- Operation: Concatenation (adds to the end of)
- Example:
- "abc" + "def"
- Result = "abcdef"
- See Note3
List
- Operation: Concatenation (adds to the end of)
- Example:
- [0, 0.0, <0.0, 0.0, 0.0>, ""] + [1, 1.0, <1.0, 1.0, 1.0>, "xyz"]
- Result = [0, 0.0, <0.0, 0.0, 0.0>, "", 1, 1.0, <1.0, 1.0, 1.0>, "xyz"]
Notes
- When one operand is an Integer, and the other is a Float, the Integer is first typecast to Float before addition.
- This operator is rarely used with this type as it is not a meaningful way of combining quaternions being used to represent rotations.
- Use the Multiplication operator instead.
- While Keys are a specialized type of String They cannot be directly used with this operator.
- needs link for article about min/max integer/float values
- needs link for article about max string and list lengths
- It'd be helpful if someone wrote a template for this page so that it might be abstracted to other operators after layout is finalized