umsh1ume's blog

By umsh1ume, history, 8 years ago, In English

I was trying to find binomial co-efficient nCr mod 1000000007 (n and r are large) using inverse modulo but there is some error. What is the problem in this code? https://ideone.com/SWPmty

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
8 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Well I'd suggest that you rename your power function

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

pow() is already a library function which returns a double instead of an int , which may be giving wrong answer after typecasting to int .