I need approssimation of pi with x digits

Hi, i would need to choose number of significative digits with which display, for example, pi or another value. Is there a way to set this?

답변 (3개)

Robert Cumming
Robert Cumming 2011년 12월 8일

0 개 추천

help format
help fprintf

댓글 수: 1

Walter Roberson
Walter Roberson 2011년 12월 8일
And if more than 15 digits are required, then switch to the Fixed Point toolkit or the Symbolic Toolkit.

댓글을 달려면 로그인하십시오.

Matman86 Di
Matman86 Di 2011년 12월 8일

0 개 추천

Ok, question is more complicated...give the series sum_i^n 4*h/(1+(i*h)^2 I have to find N value that gives me pi with x significative digits...possible?

댓글 수: 1

Walter Roberson
Walter Roberson 2011년 12월 8일
Not possible. If I set h to be 0 or negative, the result of the summation can never be positive.

댓글을 달려면 로그인하십시오.

Matman86 Di
Matman86 Di 2011년 12월 8일

0 개 추천

Sorry, h is 1/N that's the series approximation of pi I forgot to tell.

댓글 수: 1

Walter Roberson
Walter Roberson 2011년 12월 8일
All that tells is us that h is (in the absence of further assumptions) not 1/0 . N is not bound by the problem, so we are free to set it to any number we choose, including N = -1/50 (leading to h = -50) or to N = infinity (leading to h = 0).
Keep in mind, when considering this, that the problem statement has left us open to using any arbitrary lower bound on the summation, since no lower bound was given. And effectively any arbitrary upper bound too, since the upper summation bound, n, does not otherwise appear in the problem statement.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

질문:

2011년 12월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by