In the lounge, there is a topic floating around about pi and e. So I was just messsing around on my computer, and decided to make a program to calculate pi to varying degrees of accuracy. I was using this formula here:
quote:
to calculate pi: n/2 * sin(360/n)
The larger n is, the more accurate pi is where sine is in degrees.
Now, when I enter this into a calculator, using the value 2 for N, it comes out all fine and dandy, but when I threw it into my C++ program, I get all weird results. Basically, I have this for my output
quote:
std::cout << number/2*sin(360/number)
Now, when I enter the number 2, it gives me the result 0.8128... but this isn''t the right answer, on the calculator, it said, 3.141...
What giveS?
http://www.big-mommas-titty-warehouse.tk
unzip; strip; touch; finger; mount; fsck; more; yes; fsck; fsck; fsck; umount; sleep;