[英]Math.Pow C# negative number
What Excel does is (-1)*(4^(1/3)). Excel 所做的是 (-1)*(4^(1/3))。 The NaN comes from the fact that the correct result is obviously a complex number, so you might want to look into C# complex type. NaN 来自这样一个事实,即正确的结果显然是一个复数,因此您可能需要查看 C# 复杂类型。
You can use double x =-1*(double)Math.Pow(4, (double)(1.0/3)) ;
您可以使用double x =-1*(double)Math.Pow(4, (double)(1.0/3)) ;
to get same results in csharp.在 csharp 中获得相同的结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.