decimalToFactorial

fnsize_t decimalToFactorial(ulong decimal, ref ubyte[21] fac) @safe pure nothrow @nogc

This function transforms decimal value into a value in the factorial number system stored in fac.

A factorial number is constructed as:

fac[0] 0! + fac[1] 1! + ... fac[20] * 20!

Parameters

decimalThe decimal value to convert into the factorial number system.
facThe array to store the factorial number. The array is of size 21 as ulong.max requires 21 digits in the factorial number system.

Returns

A variable storing the number of digits of the factorial number stored in

fac.