TOpenCLValue Power(TOpenCLValue Base, TOpenCLValue Exponent)
Raises base to any power.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Base | TOpenCLValue | source TOpenCLValue |
| 2 | Exponent | TOpenCLValue | source TOpenCLValue |
Returns: TOpenCLValue
Remarks:
Computes Base^(Exponent). The Dew.Math.TOpenCLValue.IntPower is faster, if Exponent is an integer. Real valued power can handle only positive Exponent. Dew.Math.TOpenCLValue.IntPower can handle negative exponent also. To compute a power to the negative exponent in general case or when the base is negative, use the complex version of the function.
Examples
using Dew.Math;
using Dew.Math.Units;
namespace Dew.Examples
{
void Example()
{
TOpenCLValue a,b,c;
clMtxVec.CreateIt(out a, out b, out c);
try
{
b.Copy(2.3);
c.Copy(4);
a.Power(b, c); // a = b^c
}
finally
{
clMtxVec.FreeIt(ref a, ref b, ref c);
}
}
}
See Also: TOpenCLValue.IntPower