|
From: Noorez K. <dar...@ho...> - 2005-04-30 22:16:11
|
trying to make something to calculate PI to a large place value. The compile
error is on the marked line
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
const double numerator = 4;
unsigned double PI = 4; // short, signed or unsigned invalid for `PI'
bool add = false;
for(double i = 3; i < 999999999; i+=2)
{
if( add )
{
PI += numerator/i;
add = false;
}
else
{
PI -= numerator/i;
add = true;
}
}
cout << PI << endl << endl;
system("pause");
}
_________________________________________________________________
Don't just Search. Find! http://search.sympatico.msn.ca/default.aspx The new
MSN Search! Check it out!
|