calculates pi to arbitrary digits