Type alias Factorial<T>

Factorial<T>: ParseSignFloatNumber<T> extends infer Number extends SignFloatNumber
    ? Number["sign"] extends "+"
        ? Number["float"]["frac"]["length"] extends 0
            ? StringifySignFloat<SignFloatNumber<"+", FloatNumber<FactorialInt<Number["float"]["int"]>, []>>>
            : never
        : never
    : never

Calculate the factorial of a number

Type Parameters

  • T extends NumberLike

    The number to calculate the factorial of

    type Example = Factorial<"5">
    

Generated using TypeDoc