Raising a Numeric Value to the Power of Another Numeric Value: pow() Function

Preferences - Do not show ads

The pow() function is used to raise a numeric value to the power of another numeric value. Its syntax is:


Float.pow(numeric_value1, numeric_value2);


The pow() function returns the result of raising numeric_value1 to the power of numeric_value2, i.e. numeric_value1numeric_value2. If any error occurs, it returns the invalid value.

Note that if numeric_value1 is smaller than zero, numeric_value2 must be an integer. If numeric_value1 is zero, numeric_value2 must be zero or greater than zero.

The following WMLScript example demonstrates how to use the pow() function:


x = Float.pow(10, 2);
y = Float.pow(10.5, 2.5);


After the execution of the above script, x has the floating-point value 100.0 and y has the floating-point value 357.251.


Page 53 of 71 Previous Page | Next Page
Contents at a Glance
Print this Web Page | | Back to Top

Feedback Form (Expand)

What do you think about this web page?






WMLScript Tutorial Table of Contents WMLScript Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page