Did you try the code ? It's working fine ( no overflow ) but it's also limited. I didn't say that it's not. I wanted to write a code which calculates the factorial of 1000 but it's also working for greater values. The vector can hold a result with more than 10.000 digits , but it's limited.