20040508, 02:50  #1 
May 2004
5^{2} Posts 
New way to Find (X^Y) % M
here i had developed a simple algorithm to calculate (X^Y)%M. i works well and faster than any string manipulated operations.
//(x^y)%m long r1 = x % m; // loop upto y  1, for x ^(y1) for (long i = 0; i < y  1; i++) { r1 = (r1 * x) % m; } hope this works... mahesh 
20040508, 02:53  #2 
May 2004
5^{2} Posts 
note r1 is the result of the function

20040508, 03:16  #3 
Aug 2002
101000000_{2} Posts 
Look at my reply in the math section....

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Where can I find a Reverse and Add program? I can't find any!  Stargate38  Programming  18  20150710 06:08 
Help Find a Sequence?  davar55  Math  2  20100219 16:54 
Find the Value  davar55  Puzzles  7  20090702 19:46 
Find the Value  davar55  Puzzles  25  20070715 15:56 
New way to Find (X^Y) % M  maheshexp  Miscellaneous Math  29  20040830 15:59 