Decimal Math.Pow Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2
Overload List
Pow( | Returns a specified number raised to the specified power. |
Pow( | Returns a number raised to an integer power. |
Pow(Decimal, Decimal)
Returns a specified number raised to the specified power.
public static decimal Pow(
decimal value,
decimal exponent
)
Parameters
- value Decimal
- A decimal value to be raised to a power.
- exponent Decimal
- A decimal value that specifies a power.
Return Value
DecimalThe number value raised to the power exponent.
Exceptions
Divide | value is zero and exponent is less than zero. |
Overflow | The result is too large to be represented by a decimal value. |
Argument | Both value and exponent are zero -or- value is negative and exponent is not an integer. |
Pow(Decimal, Int32)
Returns a number raised to an integer power.
public static decimal Pow(
decimal value,
int exponent
)
Parameters
Return Value
DecimalThe real number raised to the specified exponent.
Remarks
Raising a number to an integer power is orders of magnitude faster than raising a number to a real power. If you know the exponent is an integer, use this method instead of the Pow(Double, Double) method of Math.
Exceptions
Divide | value is zero and exponent is less than zero. |
Overflow | The result is too large to be represented by a decimal value. |