Modular Exponentiation 2 by m.ukai

open Int64
let rec(!)_=Scanf.scanf"%Ld %Ld %Ld "(f one)and f s a b c=b>zero&f[|s;rem(mul s a)c|].(to_int(logand b one))(rem(mul a a)c)(shift_right b 1)c;Printf.printf"%Ld
"s;!0;;!0

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page