Operation with big numbers (remainder of division)

I have to build a program that calculates the remainder of the expression

(2^10)!/((2^10-500)! * 500!)

when divided by 10^9+7

where x^y = x*x*x*x...*x (y times)
and x! = x*(x-1)...*1

How can I do that?
I know how to calculate the remainder of x! and the remainder of y!, but I do not know how t calculate the remainder of x!/y!. I canĀ“t even store this in a variable because x! is very large.

Is there an easy way to find this?

[]'s
Joao
(a+b) mod m = (a mod m + b mod m) mod m
(a*b) mod m = (a mod m * b mod m) mod m


> (2^10)!/((2^10-500)! * 500!)
that looks like C(2^10, 500) to compute use http://en.wikipedia.org/wiki/Pascal%27s_rule
Topic archived. No new replies allowed.