Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Matlab R2014a version gives, -3.1175^0.5 = -1.7656 but (-3.1175)^0.5 = 0.0000 + 1.7656i Why?

1 Ansicht (letzte 30 Tage)
milan
milan am 29 Mär. 2016
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Matlab R2014a version gives, -3.1175^0.5 = -1.7656 but (-3.1175)^0.5 = 0.0000 + 1.7656i
Why?

Antworten (2)

Orion
Orion am 29 Mär. 2016
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

Steven Lord
Steven Lord am 29 Mär. 2016
The power operator ^ has higher precedence than the unary minus operator - but parentheses () have higher precedence than either ^ or -.

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by