how to evaluate pi out to 28 decimal places.

I am using matlab on my school campus for a math project. I have tried every way i know how to express pi out to the 28 decimal place, but i can only get it to go to the 16th place than a bunch of zeros after that. Is there a specific code that i can put in that will let me go out that far or is that the farthest..

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 17 Feb. 2011

1 Stimme

char(vpa(sym('pi'),28))
Note that this will be a string. You can't store 28 decimal places of Pi in an IEEE 754 double precision number.

2 Kommentare

Juan
Juan am 17 Feb. 2011
thank you that is exactly what i needed... i dont know why it was so hard for me to find
Juan
Juan am 17 Feb. 2011
is there anyway to write it so it does not round the last number off

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by