How to work out how many bits the result of a factorial should take up as a number?
问题 The factorial function could return a very large number as a result. How could I work out the size of the data which must return as a result of the factorial? Is there a function which can give me the size of the data quickly based upon the number n for which we are computing the factorial? For example, factorial (5) = 5 * 4 * 3 * 2 = 120 The number 120 will be 120 = 0b1111000 where 0b indicates this is a binary number. At least, I need 7 bits to represent the result and probability I would