Factorial

com.phasmidsoftware.number.core.misc.Factorial
object Factorial

The Factorial object provides methods to compute the factorial of a given non-negative integer. The calculation is implemented using tail recursion for improved performance and optimization.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Factorial.type

Members list

Value members

Concrete methods

def apply(n: Int): BigInt

Computes the factorial of a given non-negative integer using tail recursion.

Computes the factorial of a given non-negative integer using tail recursion.

Value parameters

n

The non-negative integer for which the factorial is to be computed. Must be a non-negative value; behavior is undefined for negative inputs.

Attributes

Returns

The factorial of the input n, as a BigInt.