\(\displaystyle \pi = 4\int_0^1\sqrt{1-x^2} dx\) which is based off of the area of a quarter of a circle with radius one and center \(\displaystyle (0, 0)\). And I used:

\(\displaystyle \pi = 2\int_0^1\sqrt{1 + \frac{x^2}{1-x^2} } dx\) which is based of the integral distance formula and the relationship \(\displaystyle \pi = \frac{Circumferance}{Diameter}\)

Which integral is best to use in approximating pi in a computer program? And also, visual basic rounds off calculations (after a considerable decimal place), but I would like to be able to display many correct decimal places of \(\displaystyle \pi\) and \(\displaystyle e\). When I plug in large numbers of rectangles my computer freezes for a few seconds and on larger inputs it simply states "overload". Is there a way to break up the rectangles into parts and express the decimal as a further extended expansion by some seperate technique? So I can approximate to an even greater accuracy without my computer freezing and without visual basic rounding it off?

Thanks in advance