Talk:Modular exponentiation: Difference between revisions

(→‎What if m < 0?: Save us an argument; exclude the case)
(→‎Tell algorithm?: new section)
Line 6:
My draft currently specifies m &ne; 0. The answer when m < 0 might be ill-defined or inconsistent. Should I change from m &ne; 0 to m > 0 here? --[[User:Kernigh|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). –[[User:Dkf|Donal Fellows]] 02:00, 21 December 2011 (UTC)
 
== Tell algorithm? ==
 
What's with needs improvement on the Java solution? A number of other solutions here just call a library function. In general, library algorithms might not always be known, or may change without notice so I'm not a big fan of telling library algorithms. As with so many other tasks, this one could go in different directions: Allowing simple library solutions, disallowing simple library solutions, or requiring a specific algorithm. The [[en.wikipedia.org/wiki/Modular_exponentiation#Right-to-left_binary_method|binary]] algorithm is an important one. It wouldn't be so bad to require an implementation of that specific algorithm. &mdash;[[User:Sonia|Sonia]] 18:19, 24 December 2011 (UTC)
1,707

edits