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!