rootTesterResidual

# rootTesterResidual - double root = squareRoot(x eps...

This preview shows pages 1–2. Sign up to view the full content.

//======================================== //rootTesterResidual.cpp // Code to test my second square root function. //======================================== #include  #include  using namespace std; double squareRoot(double x, double eps); //=====================>> main << ============== int main(void) { cout.precision(15); //resolution of digits shown double x; double eps; cout<< "Input x and the desired residual [q to quit]:> "; cin >>x; cin >>eps; while(not cin.fail()) { //we have valid input, so give it a try

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: double root = squareRoot(x, eps); cout << " squareRoot("<<x<<", "="" <<eps<<")=";<br> cout <<root<<endl;<br> cout<<" sqrt("="" <<x<<="" ")=" <<sqrt(x)<<endl;<br> cout<<" difference=" << root-sqrt(x)<<endl;<br> cout<<" residual="<<root*root-x<<endl;<br> cout<<" =="=================================="<<endl;<br"> cout<<"Input x and the desired residual [q to quit]:> "; cin>>x; cin>>eps; } cout<< "Thanks for playing!" <<endl; return 0; }</endl; </x<<",>...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

rootTesterResidual - double root = squareRoot(x eps...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online