MATLAB: Suspicious value in vpa

precisoionvpa

How does vpa returns suspicious values like
vpa(1e50, 60) produces 100000000000000000000000000000000000000000000000000.0 which is fine,
while
vpa(1.1e50, 60) produces 110000000000000008392746825201075703624461468041216.0.
Where does "…8392746825201075703624461468041216" come from?

Best Answer

vpa('1.1e50', 60)
ans =
110000000000000000000000000000000000000000000000000.0
When you say 1.1e50 not in single quotes, it converts it to a double (~16 digits) and then to vpa. If the number can't be evenly represented in double it shows up like above.