powmod

modular exponentation: calculate the result of (base^exponent) % divider


Parameters

powmod base :integer
       exponent :integer
       divider :integer

Returns

  • :null
  • :integer

Examples

copy
powmod 1 10 3 ; => 1 powmod 3 2 6 ; => 3 powmod 5 5 15 ; => 5 powmod 2 3 5 ; => 3 powmod 2 4 5 ; => 1 print (powmod 2 168277 673109) = (2 ^ 168277) % 673109 ; true

Related