I am converting a number given by the user to hyperbolic functions, I have the code written I just need help aligning the numbers. Everything is fine until I enter a negative number, or .01
What would I have to add to these cout statements?
double x;
cout << endl;
cout << "Enter a value for x" << endl;
cin >> x;
cout << endl;
cout << "Converting: " << x << endl;
cout << endl;
double e = 2.71828182846;
double minus = pow(e, x) - pow(e, -x);
double plus = pow(e, x) + pow(e, -x);
cout << setprecision(10) << "sinh(" << x << ") = " << minus / 2 << endl;
cout << setprecision(10) << "cosh(" << x << ") = " << plus / 2 << endl;
cout << setprecision(10) << "tanh(" << x << ") = " << minus / plus << endl;
cout << setprecision(10) << "coth(" << x << ") = " << plus / minus << endl;
cout << setprecision(10) << "sech(" << x << ") = " << 2 / plus << endl;
cout << setprecision(10) << "csch(" << x << ") = " << 2 / minus << endl;