"naser " <naser.sepehry@gmail.com> wrote in message
news:krs566$kqg$1@newscl01ah.mathworks.com...
> I insert a digit with vpa but it change my digit.
> would you please hell me?
>
> M=vpa(35.8662055159741179382109929234224820007262821451277998997729505792583139905076116515672679044047373935846813781752042552572372120168236917923706360824,150)
The input to VPA is interpreted as a double precision value before it gets
into VPA. Therefore by the time VPA can operate on it, you've already lost
precision. In order to avoid this, the input to VPA needs to be either a
string or a symbolic object -- and that symbolic object has to be
constructed in such a way that it doesn't suffer the same problem.
M = vpa(sym(2)^(1/3), 150)
Note that I converted 2 into a symbolic value THEN I computed its cube root
symbolically and printed 150 digits using VPA. Compare this which performs
the cube root in double precision THEN converts that value into a symbolic
expression.
M2 = vpa(sym(2^(1/3)), 150)
--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com