Factorial class
A utility class for calculating various types of factorials.
This class provides static methods to compute standard factorial (n!), double factorial (n!!), rising factorial (Pochhammer symbol), and falling factorial for non-negative integer inputs.
Due to the rapid growth of factorial values, all methods return BigInt to prevent overflow.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
calculate(
int n) → BigInt -
Calculates the factorial of a non-negative integer
nusing an iterative approach. -
calculateDouble(
int n) → BigInt -
Calculates the double factorial (n!!) of an integer
nusing an iterative approach. -
calculateFalling(
int x, int n) → BigInt -
Calculates the falling factorial of
xto the power ofn. -
calculateRising(
int x, int n) → BigInt -
Calculates the rising factorial (Pochhammer symbol) of
xto the power ofn.