0

how should i calculate modulus of very high powers. like 9^53 mod 25. and if possible can anyone help me with its code in android. Thanks in advance

  • This has already been asked before. Reference: http://stackoverflow.com/questions/2177781/how-to-calculate-modulus-of-large-numbers – KSdev Nov 15 '13 at 16:14

1 Answers1

0

You should use the BigInteger.modPow method or an equivalent solution that uses an efficient modular exponentiation algorithm.

Joni
  • 108,737
  • 14
  • 143
  • 193