The decimal value to convert into the factorial number system.
The array to store the factorial number. The array is of size 21 as ulong.max requires 21 digits in the factorial number system.
A variable storing the number of digits of the factorial number stored in fac.
ubyte[21] fac; size_t idx = decimalToFactorial(2982, fac); assert(fac[0] == 4); assert(fac[1] == 0); assert(fac[2] == 4); assert(fac[3] == 1); assert(fac[4] == 0); assert(fac[5] == 0); assert(fac[6] == 0);
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!