I don't have a clue how to "break" this to actually return a negative square, but that is what I need to figure out. For example, the sqrt of -100 should be -10, but I just get the error telling me that's silly (-1#.IND).
Code:#include <iostream> #include <cmath> using namespace std; double wierdsquareroot(double x) { return sqrt(x); } int main () // Program calculates the square root of a number { double num; do { cout << "Enter a number (a double): "; cin >> num; cout << "The square root is " << wierdsquareroot(num) << endl; }while (num != 0); }