Talk:Modular exponentiation

Revision as of 02:00, 21 December 2011 by rosettacode>Dkf (→‎What if m < 0?: Save us an argument; exclude the case)

Draft change

About 21 hours after I posted this draft, I changed the task from "last 20" to "last 40 decimal digits". I adjusted some solutions to print 40 digits, but I did not change the Go or Java programs. --Kernigh 19:49, 19 December 2011 (UTC)

What if m < 0?

My draft currently specifies m ≠ 0. The answer when m < 0 might be ill-defined or inconsistent. Should I change from m ≠ 0 to m > 0 here? --Kernigh 23:18, 20 December 2011 (UTC)

You could specify them all to be positive integers without causing problems; that's the only case that anyone actually wants in practice, and the others get into arguments (due to differing interpretations of how to extend the modulus operation to non-positive-valued domains). –Donal Fellows 02:00, 21 December 2011 (UTC)
Return to "Modular exponentiation" page.