power (XForms function)Added by IBM on October 10, 2012 | Version 1 (Original)
|Calculates the value of xn, where you supply x and n.
Table 1. power parameter
|xvalue||number||The base number. This is raised to the power of n.|
|nvalue||number||The exponent. This is applied the x value.|
Returns A number representing the result, or NaN if the result is not a real number.
Example The following model uses the power function to apply the Pythagorean theorem to the sides of a triangle. The user enters sides a and b into fields that are linked to the <a> and <b> data elements. Side c is then calculated by the xforms:bind, which uses the power function to get the square root of a2 + b2 . This value is then stored in the <c> data element.
calculate="power(../a * ../a + ../b * ../b, 0.5)"/>