Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Matlab R2014a version gives, -3.1175^0.5 = -1.7656 but (-3.1175)^0.5 = 0.0000 + 1.7656i Why?
1 回表示 (過去 30 日間)
古いコメントを表示
Matlab R2014a version gives, -3.1175^0.5 = -1.7656 but (-3.1175)^0.5 = 0.0000 + 1.7656i
Why?
0 件のコメント
回答 (2 件)
Orion
2016 年 3 月 29 日
Because of the parenthesis.
The power operation is executed before the minus operation, so
-3.1175^0.5
is strictly equivalent to :
-(3.1175^0.5)
which is not the same as
(-3.1175)^0.5
0 件のコメント
Steven Lord
2016 年 3 月 29 日
The power operator ^ has higher precedence than the unary minus operator - but parentheses () have higher precedence than either ^ or -.
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!