I'm trying to add up a large number but it's not coming out correctly.
var searchSpace = 36;
var length = 11;
var combinations = 0;
for(var i = 1; i <= length; i++) {
combinations += Math.pow(searchSpace, i);
}
The variable combinations
ends up being 135,382,323,952,046,190 which is not quite correct. It should be 135,382,323,952,046,196 (how is it off by 6?!) Any ideas?