Out of curiosity, i'm coding a small JavaScript program to estimate the value of the number e, given by the series 1/n! from zero to infinity. The problem is that because of the IEEE 754 standard, my answer is rounded to 16 decimals, no matter how many terms I evaluate.
Is there a way to store the first 16 decimals in a string once the value reaches a point where new decimals aren't taken into account, then calculate the next 16 (and so on and so forth) and then add the strings together to get say 32,64 or 128 decimals?
What I have so far;
var e = 1;
var f = 1;
for (var n = 1; n < 1000; n++) {
f *= n; //factorial
e += (1 / f);
}
console.log(e);
This question does not pertain to rounding issues (as flagged).