private double f(double x, double zn = 1)
{
double X = - zn;
X *= x * x * (x + 1);
X *= Math.Pow((x - 2), 0.333);
return funct ? x : X;
}
我有这个代码。当我试图找到 Math.Pow((x-2), 0.333) - 我有 NaN。如何解决?为什么是 NaN?
重写...
private double f(double x, double zn = 1)
{
double answer = - zn;
answer *= x * x * (x + 1);
answer *= Math.Pow((x - 2), 0.333);
return answer;
}