Difference between revisions of "LlPow"

From Second Life Wiki
Jump to navigation Jump to search
m
(18 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{LSLFunctionAll
{{LSL_Function
|func=llPow
|sort=Pow|func=llPow
|func_id=5
|func_id=5|func_sleep=0.0|func_energy=10.0
|func_sleep=0.0
|func_footnote=Triggers a [[LSL_Math_Error|Math Error]] for imaginary results <code>(({{LSLPT|exponent}} != ([[integer]]){{LSLPT|exponent}}) && ({{LSLPT|base}} < 0.0))</code> when not compiled in mono.{{PBR}}
|func_energy=10.0
Returns NaN when compiled in mono without crash
|func_footnote=Triggers a [[LSL_Math_Error|Math Error]] for imaginary results (val < 0.0)
|p1_type=float|p1_name=base|p1_desc
|p1_type=float
|p2_type=float|p2_name=exponent|p2_desc
|p1_name=base
|p1_desc
|p2_type=float
|p2_name=exponent
|p2_desc
|p3_type|p3_name|p3_desc
|p4_type|p4_name|p4_desc
|p5_type|p5_name|p5_desc
|p6_type|p6_name|p6_desc
|p7_type|p7_name|p7_desc
|p8_type|p8_name|p8_desc
|p9_type|p9_name|p9_desc
|p10_type|p10_name|p10_desc
|p11_type|p11_name|p11_desc
|p12_type|p12_name|p12_desc
|return_type=float
|return_type=float
|return_text=that is the square root of val.
|return_text=that is {{LSLP|base}} raised to the power {{LSLP|exponent}} ({{LSLP|base}}<sup>{{LSLP|exponent}}</sup>)
|spec
|spec
|caveats=* Crashes the script if passed a negative number.
|caveats=* Can crash the script when not compiled in mono
|examples
|examples=
<source lang="lsl2">default {
    state_entry() {
          llOwnerSay("llPow(5, .5) (" + (string)llPow(5, .5) + ") is equal to llSqrt(5) ("
                      + (string)llSqrt(5) + ").");
    }
}</source>
|helpers
|helpers
|also
|also_functions={{LSL DefineRow||[[llLog]]|}}
{{LSL DefineRow||[[llLog10]]|}}
{{LSL DefineRow||[[llSqrt]]|}}
|also_events
|also_articles
|also_tests
|notes
|notes
|cat1=Math
|cat2=Error/Math
|cat3
|cat4
}}
}}
[[Category:LSL_Functions]]
[[Category:LSL_Math]]
[[Category:LSL_Error/Math]]
{{lowercase|llPow}}
__NOTOC__
{| width="100%"
|-
|<div id="box">
== [[LSL_Type_float|float]] llPow( [[LSL_Type_float|float]] base, [[LSL_Type_float|float]] exponent); ==
<div style="padding: 0.5em">
* base -
* exponent -
</div>
</div>
|-
|
<div id="box">
== Specification ==
<div style="padding: 0.5em">
Returns base raised to the exp.
Returns 0 and triggers a Math Error for imaginary results
{|
|-
| [[LSL_Energy|Energy]]:
| 10.0
|-
| [[LSL_Sleep|Sleep]]:
| 0.0
|-
| [[LSL_Function_ID|Function ID]]:
| 5
|}
</div>
</div>
|-
|
<div id="box">
== Caveats ==
<div style="padding: 0.5em">
</div>
</div>
|-
|
<div id="box">
== Examples ==
<div style="padding: 0.5em">
<lsl>
</lsl>
</div>
</div>
|-
|
<div id="box">
== Helper Functions ==
<div style="padding: 0.5em">
<lsl>
</lsl>
</div>
</div>
|-
|
<div id="box">
== See Also ==
<div style="padding: 0.5em">
</div>
</div>
|-
|
<div id="box">
== Notes ==
<div style="padding: 0.5em">
</div>
</div>
|}
[[Category:LSL_Functions]]
[[Category:LSL_Math]]

Revision as of 13:28, 14 September 2015

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)) when not compiled in mono. Returns NaN when compiled in mono without crash

Caveats

  • Can crash the script when not compiled in mono
All Issues ~ Search JIRA for related Bugs

Examples

default {
     state_entry() {
          llOwnerSay("llPow(5, .5) (" + (string)llPow(5, .5) + ") is equal to llSqrt(5) (" 
                      + (string)llSqrt(5) + ").");
     }
}

See Also

Functions

•  llLog
•  llLog10
•  llSqrt

Deep Notes

Search JIRA for related Issues

Signature

function float llPow( float base, float exponent );