Difference between revisions of "LSL Addition"
Jump to navigation
Jump to search
(Because the category include syntax trumps link syntax. You have to use explicit link syntax to bypass the collision. Don't you just love wiki markup? Makes things so much simpler. 9_9) |
|||
Line 7: | Line 7: | ||
|content= | |content= | ||
=== This operator affects the following types === | === This operator affects the following types === | ||
* [[Integer]] | * [[Integer]]: Addition | ||
** Example: | ** Example: | ||
** 1 + 1 | *** {{HoverText|1|integer}} + {{HoverText|1|integer}} | ||
*** Result = 2 | *** Result = {{HoverText|2|integer}} | ||
* [[Float]] | * [[Float]]: Addition | ||
** Example: | ** Example: | ||
** 1.0 + 1.0 | *** {{HoverText|1.0|float}} + {{HoverText|1.0|float}} | ||
** 1.0 + 1 | *** {{HoverText|1.0|float}} + {{HoverText|1|integer}} | ||
** 1 + 1.0 | *** {{HoverText|1|integer}} + {{HoverText|1.0|float}} | ||
*** Result = 2.0 | *** Result = {{HoverText|2.0|float}} | ||
* [[Vector]] | * [[Vector]]: Addition | ||
** Example: | ** Example: | ||
** <1.0, 1.0, 1.0> + <1.0, 0.0, -1.0> | *** <1.0, 1.0, 1.0> + <1.0, 0.0, -1.0> | ||
*** Result = <2.0, 1.0, 0.0> | *** Result = <2.0, 1.0, 0.0> | ||
* [[Rotation]] | * [[Rotation]]: Addition | ||
** Caution: | |||
*** This operator is rare used with this type as it is not a meaningful way of combining [[quaternion]]s being used to represent directions. | |||
****Use [[LSL *#Rotation|*]] and [[LSL /#Rotation|/]] instead. | |||
** Example: | ** Example: | ||
** <0.0, 0.0, 0.0, 1.0> + <1.0, 0.0, 0.0, 1.0> | *** <0.0, 0.0, 0.0, 1.0> + <1.0, 0.0, 0.0, 1.0> | ||
*** Result = <1.0, 0.0, 0.0, | *** Result = <1.0, 0.0, 0.0, 1.0> | ||
* | <!-- * [[Key]] Key's don't support addition... I'm pretty sure at least. --> | ||
* [[String]] | * [[String]]: Concatenation | ||
** Example: | ** Example: | ||
** "a" + "a" | ** "a" + "a" | ||
** Result = "aa" | |||
* [[List]] | * [[List]]: Concatenation <!-- Needs to be more explicit about mixing types. --> | ||
** Example: | ** Example: | ||
** [1] + [2] | ** [1] + [2] | ||
Line 39: | Line 42: | ||
|title=Notes | |title=Notes | ||
|content= | |content= | ||
* | * This operator cannot be used on [[key]]s. | ||
* link article about min/max integer/float values | * link article about min/max integer/float values | ||
* link article about max string, key, and list lengths | * link article about max string, key, and list lengths | ||
====Footnotes==== | |||
{{Footnotes}} | |||
}} | }} | ||
[[Category:LSL_Operators]] | [[Category:LSL_Operators]] |
Revision as of 16:18, 11 January 2010
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
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
- Example:
- Float: Addition
- Example:
- 1.0 + 1.0
- 1.0 + 1
- 1 + 1.0
- Result = 2.0
- Example:
- Vector: Addition
- Example:
- <1.0, 1.0, 1.0> + <1.0, 0.0, -1.0>
- Result = <2.0, 1.0, 0.0>
- Example:
- 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.
- 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>
- Caution:
- 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