Why the both results are different
이전 댓글 표시
I compute the little program in matlab
clear; clf;
syms a b
f1 = 96*pi - 16*pi * (log(a)-log(b)+1)
f1_ = subs(f1,[a b],[12 2])
f1_ = vpa(f1_)
f2 = 96*pi - 16*pi*(log(12)-log(2)+1)
with the output
f1 =
f1_ =
f1_ =
f2 = 161.2638
Why the results are different?
댓글 수: 2
Walter Roberson
2020년 6월 8일
Ah, sorry, somehow when I formatted your code, the special characters disappeared!! If you could repost that part, that would be good.
Walter Roberson
2020년 6월 8일
When I test, I get
f1_ =
161.26375811875458240605931894947
f2 =
161.263758118755
The first of those has been computed to higher precision.
The first has also been computed in a mode that recognized pi as being the indefinitely precise transcendental number, whereas the second one that was calculated purely numeric was calculated with the 16-digit numeric approximation of pi.
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


