C# High double precision
I'm writing a function that calculates the value of PI, and returns it as a double. So far so good. But once the function gets to 14 digits after the decimal place, it can't hold any more. I'm assuming this is because of the double's limited precision. What should I do to continue getting more numbers after the decimal place? I wouldn't do it in floating point at all. Recall that your algorithm is: (1 + 1 / (2 * 1 + 1)) * (1 + 2 / (2 * 2 + 1)) * (1 + 3 / (2 * 3 + 1)) * (1 + 4 / (2 * 4 + 1)) * (1 + 5 / (2 * 5 + 1)) * (1 + 6 / (2 * 6 + 1)) * (1 + 7 / (2 * 7 + 1)) * ... Every stage along the way