I am dealing with very big numbers, on the scale of 10^500
,10^800
.
When I try to calculate 10^309
it reurns inf
.
>> 10^309
ans =
Inf
I tested format long
it also returns inf
.
>> format long
>> 10^309
ans =
Inf
I also tested the vpa
function:
vpa(10^309,309)
ans =
Inf
how can I calculate and use big numbers in my calculation?
I cannot use a logarithm, because I require all digits in the very large numbers. i.e. I want MATLAB to return the following for 10^308
vpa(10^308,308)
ans =
100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Can anyone help me to do this?