3
$\begingroup$

I'm looking for solution to a problem to calculate modulo of very large number that can contain 25000 digits or less (n) with 10 digit number (m). ( n % m ) ?

Pointer to appropriate theory resource is also welcome.

Thanks

  • 0
    You mean on a computer? You'll probably have to use a bignum library of some kind – in which case this is just a programming question, rather than mathematics.2012-11-04
  • 0
    Do you have the numbers in some special form or are you asking about the general case?2012-11-04
  • 0
    @KarolisJuodelė General Case.2012-11-04
  • 0
    Why is the case of large number different from the case of small numbers? As Zhen asked, is this a programming problem?2012-11-04
  • 0
    @KarolisJuodelė Yes, this is a programming problem but I do not want to use bignum library. Because I think there must be interesting property of modulo which can do the task efficiently. Any good source for modular arithmetic in and out?2012-11-04
  • 0
    @Jaini: I don't understand your comment. What would the existence of an "interesting property" have to do with whether you want to use a bignum library that implements it? How do you plan on obtaining the big number anyways?2012-11-04
  • 1
    If I had to guess, the big number is obtained by exponentiating something, in which case the most efficient course of action is to keep reducing modulo $m$ while computing $n$ in the first place!2012-11-04

1 Answers 1