A fast routine for computing integer powers. Code adapted from http://mindprod.com/jgloss/power.html by Patricia Shanahan pats@acm.org Almost identical to the method Knuth gives on page 462 of The Art of Computer Programming Volume 2 Seminumerical Algorithms.

Namespace:  SingularSys.Jep.Functions
Assembly:  Jep (in Jep.dll) Version: 1.1.0.0 (1.0.0)

Syntax

C#
public double PowerOp(
	double l,
	int n
)
Visual Basic (Declaration)
Public Function PowerOp ( _
	l As Double, _
	n As Integer _
) As Double
Visual C++
public:
double PowerOp(
	double l, 
	int n
)

Parameters

l
Type: System..::.Double
number to be taken to a power.
n
Type: System..::.Int32
power to take x to. 0 <= n <= Integer.MAX_VALUE Negative numbers will be treated as unsigned positives.

Return Value

x to the power n

See Also