LSL Wiki Mirror 10-5-2006: llPow

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
float llPow(float base, float exp)

Returns base raised to the exp.

Example:
llSay(0,(string)llPow(3.0, 2.0)); // returns 9 (3*3)
llSay(0,(string)llPow(4.0, 5.0)); // returns 1024 (4*4*4*4*4)

Remember, roots can be expressed as powers. For example,
llSqrt(4.0);        //Using the math library's square root function
llPow(4.0, 1.0/2.0);    //Using a power to return a square root

This means that one can manage a cube root, or any other root. A cube root would be expressed as
llPow(27.0, 1.0/3.0);


Functions | Math
There are 5 comments on this page. [Display comments/form]