I'm trying to make a program that you can enter the dimensions of a Rubik's cube eg. 13x13x13 and the program tells you how many permutations there are for that Rubik's cube. I have the math to figure it out, but in case you didn't know Rubik's cubes can have a lot of permutations. Just a 13x13x13 has 13.421 novemoctagintillion (1.34 * 10^271). I can't calculate anything past a 14x14x14 rubik's cube because the number of permutations exceeds 10^308
How can I some store a number larger that 10^308 in Javascript?
Here is my code so far,
function calc(){
Calc.d = Number(document.getElementById("dimensions").value);
Calc.c = factorial(8) * Math.pow(3,8) / 3;
Calc.eNumber = (Calc.d - 2) * 12;
Calc.e = factorial(Calc.eNumber) * Math.pow(2,Calc.eNumber) / 2;
Calc.a = Calc.c * Calc.e / 2;
document.getElementById("amount").innerHTML = String(convert(Calc.a));
}
Can anyone help? Thank you!!!