Difference between revisions of "LlPow"

From Second Life Wiki
Jump to navigation Jump to search
m (lsl code tagging)
m
Line 6: Line 6:
|p2_type=float|p2_name=exponent|p2_desc
|p2_type=float|p2_name=exponent|p2_desc
|return_type=float
|return_type=float
|return_text=that is '''base''' raised to the power '''exponent''' ('''base'''<sup>'''exponent'''</sup>)
|return_text=that is {{LSLP|base}} raised to the power {{LSLP|exponent}} ({{LSLP|base}}<sup>{{LSLP|exponent}}</sup>)
|spec
|spec
|caveats=* Can crash the script.
|caveats=* Can crash the script.
|examples=
|examples=
<lsl>
<lsl>default {
default {
     state_entry() {
     state_entry() {
           llOwnerSay("llPow(5, .5) (" + (string)llPow(5, .5) + ") is equal to llSqrt(5) ("  
           llOwnerSay("llPow(5, .5) (" + (string)llPow(5, .5) + ") is equal to llSqrt(5) ("  
                       + (string)llSqrt(5) + ").");
                       + (string)llSqrt(5) + ").");
     }
     }
}
}</lsl>
</lsl>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llLog]]|}}
|also_functions={{LSL DefineRow||[[llLog]]|}}

Revision as of 11:01, 29 June 2012

Summary

Function: float llPow( float base, float exponent );

Returns a float that is base raised to the power exponent (baseexponent)

• float base
• float exponent

Triggers a Math Error for imaginary results ((exponent != (integer)exponent) && (base < 0.0))

Caveats

  • Can crash the script.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>default {

    state_entry() {
         llOwnerSay("llPow(5, .5) (" + (string)llPow(5, .5) + ") is equal to llSqrt(5) (" 
                     + (string)llSqrt(5) + ").");
    }
}</lsl>

See Also

Functions

•  llLog
•  llLog10
•  llSqrt

Deep Notes

Search JIRA for related Issues

Signature

function float llPow( float base, float exponent );