Matlab sets inputs to double precision by default, so if I input a=1/3
then the variable will be converted with double precision
>> a=1/3
a =0.3333
>> whos('a')
a 1x1 8 double
However, when I input vpa(a,100)
afterwards, I get:
ans=0.3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
My question is that
since a
is at double precision and has only 8 Bytes to store its data, why can it have a precision of 100 digits when it comes to vpa(a,100)
? In a word, how does Matlab enhance the precision of a
from 'double' to 100 digits?