AngouriMath
Factorial
Method with 2 overloads
Factorial(PeterO.Numbers.EDecimal,PeterO.Numbers.EContext)
Summary
Calculates the factorial of the specified EDecimal.
This implementation uses
Spouge's approximation to calculate the factorial for non-integer values.This involves calculating a series of constants that depend on the desired precision.
Since this constant calculation is quite expensive (especially for higher precisions),
the constants for a specific precision will be cached
and subsequent calls to this method with the same precision will be much faster.It is therefore recommended to do one call to this method with the standard precision of your application during the startup phase
and to avoid calling it with many different precisions.See: Wikipedia: Factorial - Extension of factorial to non-integer values of argument Parameter "x"
The EDecimalParameter "mathContext"
The EContext used for the resultReturns
The factorial EDecimalException "ArgumentOutOfRangeException"
Thrown when the precision of themathContext is outside the int32 rangeFactorial(System.Int32)
Summary
Calculates the factorial of the specified integer argument.
factorial = 1 * 2 * 3 * ... n Parameter "n"
The Int32.Returns
The factorial EInteger.Exception "ArgumentOutOfRangeException"
Thrown if x < 0
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online