Recently, I have a question about factorial. The question is to find the division result of 2 factorials of 2 huge numbers. For example, given a=400000000 and b=30000000, find the result of fact(a) / fact(b). Since the result will be enormous, it will be modulo by some int32 value like 499555666.
I am not good at math. I know that fact(400000000) is impossible huge number.
My question is...
- Is there an algorithm that can find the result?
- Can you give me some hints and guides?