Ok, did some work on it with the help of you guys and guys from other forums, and here's the updated(and heavily fixed) code:
Code:#include <iostream> #include <string> using namespace std; double dblTrillFunc ( double dblDeciOne , double dblDeciTwo ) { //long lnTrillResult; /* double dblDeciOne(.000000000000000000002); double dblDeciTwo(.000000000000000000002); */ double lnTrillResult = ( dblDeciOne * dblDeciTwo ); return(lnTrillResult); } string intro_answer; string intro_compare = "exit"; long lnBillion = 1000000000; double z; int main() { cout << "Welcome to the Burn-A-Natar 3000! Type in anything to" << endl << \ "continue, or \"exit\" to quit: " << endl; cin >> intro_answer; if (intro_answer != intro_compare) { do { z = z + dblTrillFunc ( .0000000000000000002 , .0000000000000000002 ); cout << "We're at: " << z << " right now.\n"; } while ( z < lnBillion ); } else { cout << "Bye"; return(0); } }
That compiles, but with the result of z, it also outputs 4e-blahblah. Anyone know what the reason is?
And I wrote all this in Dev-C++. As you can see, my skills are advancing as I read more of the C++ tutorial at cplusplus.com.




Reply With Quote