i am using visual studio and writing a program to come up with a square root of a number that is prompted from the user. the error i receive is [error C2296: '^' : illegal, left operand has type 'double']. ive read my begining c++ book over and over and do not understand what is causing this error? here is my code. visual studio tells me i have an error in my while loop.
using namespace std;
const double e = 0.01;
double y, incro, guess;
cout << "Please enter a positive real number: " << endl;
cin >> y;
cout << "only positive numbers can be used" << endl;
guess = y/2.0; //start search for sqrt(y) at n/2
incro = guess/2.0; //start incro at 1/2 of guess
while (((guess*guess-y)^2)>e^2) //close enough??
guess = guess-incro;//makes guess smaller as it is too big
guess = guess+incro;//makes guess bigger as it is too small
incro = incro/2.0;