What you need to understand is how MATLAB works. When you have one function call another, it evaluates the inside operation FIRST. That is, what is the value of
So we have a number with over a hundred decimal digits, stored as a DOUBLE precision number. A double does not store all those digits. Just the top 16 or so. (Actually, it stores binary bits, regardless...) Anyway, it stores the result of the factorial as a double temporarily.
THEN you passed that result into vpa. WRONG!!!!!!
Instead, remember how MATLAB works. Think about the difference between what you wrote, and this:
Do you understand why this operation now works properly as you wish?