LSL Addition

From Second Life Wiki
Revision as of 17:18, 11 January 2010 by Strife Onizuka (talk | contribs)
Jump to navigation Jump to search

this page needs to be templatized for abstraction to other operators after layout is finalized this is only a sample layout, feel free to suggest other layouts.

Operator: +

This operator affects the following types

  • Integer: Addition
    • Example:
      • 1 + 1
      • Result = 2
  • Float: Addition
    • Example:
      • 1.0 + 1.0
      • 1.0 + 1
      • 1 + 1.0
      • Result = 2.0
  • Vector: Addition
    • Example:
      • <1.0, 1.0, 1.0> + <1.0, 0.0, -1.0>
      • Result = <2.0, 1.0, 0.0>
  • Rotation: Addition
    • Caution:
      • This operator is rare used with this type as it is not a meaningful way of combining quaternions being used to represent directions.
        • Use * and / instead.
    • Example:
      • <0.0, 0.0, 0.0, 1.0> + <1.0, 0.0, 0.0, 1.0>
      • Result = <1.0, 0.0, 0.0, 1.0>
  • String: Concatenation
    • Example:
    • "a" + "a"
    • Result = "aa"
  • List: Concatenation
    • Example:
    • [1] + [2]
      • Result = [1, 2]

Notes

  • This operator cannot be used on keys.
  • link article about min/max integer/float values
  • link article about max string, key, and list lengths

Footnotes