mersenneforum.org How does this compute
 Register FAQ Search Today's Posts Mark Forums Read

 2019-06-19, 01:06 #1 tServo     "Marv" May 2009 near the TannhÃ¤user Gate 2A616 Posts How does this compute Can someone please explain how this Mod is computed? TIA Code: (20:02) gp > (Mod(2633043,8388607)/9) %1 = Mod(5884965, 8388607) (20:02) gp > lift(%1) %2 = 5884965]
2019-06-19, 01:15   #2
paulunderwood

Sep 2002
Database er0rr

75368 Posts

Quote:
 Originally Posted by tServo Can someone please explain how this Mod is computed? TIA Code: (20:02) gp > (Mod(2633043,8388607)/9) %1 = Mod(5884965, 8388607) (20:02) gp > lift(%1) %2 = 5884965]
It computes 2633043 mod 8388607

Then 2633043/9 mod 8388607

Then "lifts" it to an integer.

It does the division by some kind of extended euclidian algorithm. Note that gcd(8388607,9)==1 must be so.

9 * 5884965 == 2633043 mod 8388607

That is 8388607 divides 9 * 5884965 - 2633043

Last fiddled with by paulunderwood on 2019-06-19 at 01:18

 2019-06-19, 01:17 #3 hansl     Apr 2019 3158 Posts https://en.wikipedia.org/wiki/Modula...cative_inverse Code: ? Mod(2633043,8388607)/9 %5 = Mod(5884965, 8388607) ? Mod(9,8388607)^-1 %6 = Mod(1864135, 8388607) ? Mod(1/9,8388607) %7 = Mod(1864135, 8388607) ? Mod(2633043*1864135, 8388607) %8 = Mod(5884965, 8388607) ?
 2019-06-22, 14:48 #4 tServo     "Marv" May 2009 near the TannhÃ¤user Gate 2×3×113 Posts Thanks ! I appreciate your time.

 Similar Threads Thread Thread Starter Forum Replies Last Post pepi37 Software 14 2018-09-08 01:26 airsquirrels GPU Computing 90 2017-12-08 00:13 NBtarheel_33 GPU Computing 54 2013-05-15 03:32 Christenson Hardware 0 2011-01-15 04:44 petrw1 Hardware 9 2007-08-13 14:38

All times are UTC. The time now is 01:05.

Thu Dec 2 01:05:21 UTC 2021 up 131 days, 19:34, 1 user, load averages: 1.07, 0.99, 0.89