Vector.IntPower Method

Overload List

#SignatureDescription
1function IntPower(Base: TMtxVec; Exponent: Integer): TMtxVec;Calculate the power Base^(Exponent) for all Base object elements using the integer Exponent value.
2function IntPower(Exponent: Integer): TMtxVec;Power (integer exponent).

Overload 1: function IntPower(Base: TMtxVec; Exponent: Integer): TMtxVec;

Calculate the power Base^(Exponent) for all Base object elements using the integer Exponent value.

#NameTypeDescription
1BaseTMtxVecsource TVec or TMtx
2ExponentInteger

Result: stored in self (calling object), returns self for chaining

Remarks:

Store the results in calling object. Size and Vector.Complex properties of calling object are adjusted automatically.

Overload 2: function IntPower(Exponent: Integer): TMtxVec;

Power (integer exponent).

#NameTypeDescription
1ExponentInteger

Result: stored in self (calling object), returns self for chaining

Remarks:

Calculate the power ^(Exponent) for all caling object elements using the integer parameter Exponent. For non integer exponents, the Vector.Power and Vector.PowerVec methods can be used.

Examples
var a,b: Vector;
begin
    a.SetIt(False,[1,2,3,4]);
    a.IntPower(3);     //same as:
    a := IntPower(a,3);
    b.IntPower(a,3); //same as:
    b := IntPower(a,3);
end;
See Also: Vector.Power, Vector.PowerVec