Raising a negative value to a fraction power?
2 次查看(过去 30 天)
显示 更早的评论
I am rasing a negative value to a fraction power. Depending on how I write the operation (putting the negative value in parenthesis or not), the answer changes (see below)? Am I missing something?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/426173/image.jpeg)
0 个评论
采纳的回答
Alan Stevens
2020-11-24
Exponentiation has a higher priority than negation, so -2^1.2 is -(2^1.2), this results in a negative real. On the other had (-2)^1.2 raises a negative number to a fractional power, because parentheses take priority over exponentiation, and the result is a complex number.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!