Подскажите, что не так? Выдает a = -nan(ind)
#include <iostream>
#include <cmath>
using namespace std;
const double P = 3.14159265;
double calculateA(double x, double y, double z)
{
double z1 = fabs(P * z / 180 - 1);
double a = (8.01 * pow(sin(3 * x * P / 180), 2) - exp(-2 * z)) / (pow(sqrt(log(y)), 1.0 / 3) + 2 * z);
return a;
}
double calculateB(double y)
{
double b = std::pow(y, 1.0 / 3) - 5 * y;
return b;
}
int main() {
setlocale(LC_ALL, "Russian");
double x, y, z;
cout << "Введите значение x (в градусах): ";
cin >> x;
cout << "Введите значение y: ";
cin >> y;
cout << "Введите значение z: ";
cin >> z;
double a = calculateA(x, y, z);
double b = calculateB(y);
cout << "a = " << a << endl;
cout << "b = " << b << endl;
return 0;
}
Источник: Stack Overflow на русском